the bigger question is: How to have a beta (test) site and production, and switch between them so easily that a user can do it.
I wrote a script that does the move. Here's what the script does:
1. saves the target wp-config DB settings 2. dumps source_DB, with --add-drop-table --add-drop-database 3. replaces all http://source/ with http://target in dump_DB.sql 4. loads source_DB.sql in Target_DB 5. (there is no cache plugin in either sites) 6. rsync --delete /source/path/ to /target/path 7. chown -R /target/path with the correct ownership
The script works perfectly. the source-site is practically identical to the target-site. The files are md5-identical between the srouce and target (except wp-config.php).
BUT! (here's are questions)
The main menu is "forgotten". I have to manually go to "menus" and select the main-menu from the drop-down box. it happens each time i switch these websites. How can that be, if the database is copied 1:1 ? Could it be that the menu is related to domain URL somehow?
the background preference (controlled by "simplify" theme") is forgotten. I have to manually select the background images from existing images.
Is there a better way to switch test-site <> production site without all this hassle? I Just want to have a test site and to switch DNS entries. My posts dont travel over the internet, so I dont need absolute URLS. changing "hosts" file solution is not acceptable for admin end-user.