RE: changes in tables (developemnt -> production)
> what steps do you recommend to do the tables update on the production
> database?
When I work on our site DB, I follow the following steps:
1. Trash the existing dev DB and replace with the current live version
2. Develop!
3. Dump all the tables I have changed (structure and/or data) using
mysqldump:
mysqldump --default-character-set=latin1 --add-drop-table -u <user> -p
<dbname> <list of tables to dump> > output.sql
4. Zip the output, FTP to live server and unzip.
5. SSH to live server and backup DB with mydqldump.
6. Import the uploaded SQL file:
mysql --database=<dbname> -u <user> -p < output.sql
The import usually takes less than a second, so there is practically no
downtime.
Note that this works well as most of my DB is 'read-only'. I have to be more
careful when updating any tables that are written to via the app.
HTH,
Edward
|