Automatic synchronization of Wordpress database requires updating

I have created an auto-sync script that does the following:

  • Clearing the current location
  • Copying dynamic files such as download
  • Back up database from target, restore and restore data

The real script is as follows:

echo Updating via SVN
export LC_ALL=fr_CA.UTF-8
svn up

echo Cleaning up the image and temp folder
rm -Rf wp-content/uploads/*

echo Copying files from production version
cp -R ../public_html/wp-content/uploads/* wp-content/uploads/

echo Importing wordpress database
mysqldump -u xxxyyyzzz --password=xxxyyyzzz xxxyyyzzz_db --skip-opt --add-drop-table --default-character-set=utf8 > temp.sql
sed 's/' temp.sql > temp2.sql
mysql -u xxxyyyzzz --password=xxxyyyzzz xxxyyyzzz_preprod_db < temp2.sql
rm temp.sql
rm temp2.sql

echo Complete


The code works great here, except for one small problem. When I load WP-ADMIN from wordpress after syncing the two projects (PROD> PREPROD) and I suspect it will do the same when I do PROD> STAGE and PROD> DEV, the admin dashboard prompts me "You 're the database is out of date, we will update it now "and many perma links fail in the database when I browse the front of the site I have synced.

Is there a Wordpress guru out there who can tell me what I might be doing wrong? Is there a cache somewhere to update or clear.

List of installed pluggins:

  • Several custom internal plugins that have nothing to do with this.
  • Preliminary custom fields
  • Gravitational forms
  • Justin Tadlock members
  • WordPress SEO by Joost de Valk
  • Multilingual CMS WPML
  • Convert strings to WPML

Hope someone knows ...

Good luck everyone


source to share

1 answer

WordPress caches a lot of information in the table wp_options

using the Transients API . Clearing the cache can fix some issues.

DELETE FROM 'wp_options' WHERE 'option_name' LIKE '_transient_%'


As MightyE said, the team sed

won't work with serialized data that many plugins use. I'm not sure if this is easy for all database tables.



All Articles