Wiki Loves Monuments mobile application/WLM DB transfer
Appearance
This page is outdated. |
- Created instance, Ubuntu 12.04
- Setup LAMP via `tasksel`
- check out PyWikipedia from Trunk (http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/) - needs to be packaged up later.
- Setup mysql config for the bot at https://commons.wikimedia.org/wiki/Commons:Monuments_database/Setup
- 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.
- run pywikipedia/login.py to check if login is setup properly
- Check out https://svn.toolserver.org/svnroot/p_erfgoed/erfgoedbot/
- Setup a mysql user and database, and make sure the user has access to the database.
- set config from 8 in erfgoedbot/monuments_config.py (database and host info)
- 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.
- set PYTHONPATH to include path to the pywikipedia source.
- install the python-mysqldb package
- Run update_database.py to start the update process.
- Run sql/fill_table_monuments_all.sql to aggregate all the different monument data into one.
- Checkout https://svn.toolserver.org/svnroot/p_erfgoed/api/ into ~/public_html/api, symlink it to /var/www/api
- Checkout https://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/ToolserverI18N/ into ~/ToolserverI18N.
- Modify file absolute path references to Toolserver18N in api/api.php
- Create ~/database.inc, with global variable $toolserver_password set to the password of the database being used. (ewww!)
- Modify database host and user information in api/includes/Monuments.php
- 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