NPO-project/database — Issue #2: Migration script
Author: dennisdegryse
Created: 2012-01-30 11:13:41+00:00
State: open

We need a script that migrates data from the tribal wars world data archives to the tribes and players table of that specific world. The migration script must take the world number and server tld as CLI arguments so that the script can be used for multiple servers.

The script should:
- download the world data to a configurable temporary directory (default /tmp)
- do an incremental update on the db via a http api:
* {baseurl}/tribes/save/{id} + all fields as POST parameters
* {baseurl}/players/save/{id} + all fields as POST parameters
* {baseurl}/players/delete/{id} for all players that are no longer on the world
* {baseurl}/tribes/delete/{id} for all tribes that are no longer on the world

conserve the sequence of execution to avoid foreign key constraint failures.