Jump to content

Wiki Loves Monuments mobile application/WLM DB transfer

From mediawiki.org
  1. Created instance, Ubuntu 12.04
  2. Setup LAMP via `tasksel`
  3. check out PyWikipedia from Trunk (http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/) - needs to be packaged up later.
  4. Setup mysql config for the bot at https://commons.wikimedia.org/wiki/Commons:Monuments_database/Setup
  5. run pywikipedia/generate_user_files.py. Generate user_config.py. Pick wikipedia. Pick en. Bot's user name (wlm-mobile-bot). Small variant. add db_username, db_password and db_hostname to the file manually. user-config.py is generated, is copyable and reusable.
  6. run pywikipedia/login.py to check if login is setup properly
  7. Check out https://svn.toolserver.org/svnroot/p_erfgoed/erfgoedbot/
  8. Setup a mysql user and database, and make sure the user has access to the database.
  9. set config from 8 in erfgoedbot/monuments_config.py (database and host info)
  10. run monument_tables.py to generate sql statements in sql/. See FIXME down. Must manually replace toolserver hostname in a few sql statements with appropriate db hostname.
  11. set PYTHONPATH to include path to the pywikipedia source.
  12. install the python-mysqldb package
  13. Run update_database.py to start the update process.
  14. Run sql/fill_table_monuments_all.sql to aggregate all the different monument data into one.
  15. Checkout https://svn.toolserver.org/svnroot/p_erfgoed/api/ into ~/public_html/api, symlink it to /var/www/api
  16. Checkout https://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/ToolserverI18N/ into ~/ToolserverI18N.
  17. Modify file absolute path references to Toolserver18N in api/api.php
  18. Create ~/database.inc, with global variable $toolserver_password set to the password of the database being used. (ewww!)
  19. Modify database host and user information in api/includes/Monuments.php
  20. Setup cron to run once a day, with something along the lines of http://hastebin.com/deranawuci.js

(more at https://commons.wikimedia.org/wiki/Commons:Monuments_database/Setup )


FIXME (will have corresponding bugs):

  • create_table_commonscat.sql has hardcoded reference to toolserver. So does fill_table_monuments_all.sql and create_view_monuments_all.sql
  • db_username, db_password, db_hostname should not be needed in user-config.py.
  • databse.inc hack on api should be fixed
  • hardcoding paths in the api should be fixed
  • Lots of things toolserver specific, should be weeded out
  • General CR needed before it can be deployed on cluster