How to move a WP site with WPML the right way

(Dette indlæg bliver oversat til dansk på et tidspunkt)

Really quick: I got quite some problems moving my new site I built for a client from my development platform to the production server. This meant changing both server, database and domain name in files and database tables.

After some (read: a lot) trial and error (a lot of errors) I believe I got it covered now.

See my problems here:

Something like this:

  • Backup old site database tables
  • (Export from myPhpAdmin, remember to zip the database)
  • Backup old site files
  • Change wp-config.php to match new site database
  • Import database tables to new site database
  • With myPhpAdmin change the following to new site info:
    • wp_options: siteurl
    • wp_options: home
    • wp_options: upload_path
      Do NOT change wp_options: icl_sitepress_settings !!!
      It will break the languages!
      Information on this would be appreciated :)
  • With myPhpAdmin do a database search for the old domain
    Everything except wp_options: icl_sitepress_settings should
    basically be changed, but be careful.

    You need to replace in these tables:

    • wp_icl_string_positions
      This got all you strings that you have translated with WPML and their locations
    • wp_posts: All the guid-records
      Posts may have manual links in other pages or posts in post_content column.
      I’d recommend changing these manually.
    • wp_postmeta
      There may be some metadata for some of your uploads, with references to
      the old domain
You may have other plugins and settings, that references the old domain.
You may be able to change these in the WordPress Administration, but you can change it here as well.
  • All occurrences of a string in a table can be replaced by another string like this:
    • Do an SQL command with myPhpAdmin:
      UPDATE tablename SET column = replace(column, “string”, “another_string”);
    • You COULD do multiple columns at once, but take it easy, no rush…
      Anyway, you COULD do it like this:
      UPDATE tablename SET column = replace(column, “string”, “another_string”),
      column2 = replace(column2, “string2”, “another_string2”);
  • Lastly, upload all the files with the wp-config.php changed to match the new site database
I hope this helps in the understanding of moving a WordPress installation with plugin from one server and domain to another.
Check out these fora as well:

3 thoughts on “How to move a WP site with WPML the right way

  1. Micke

    Thanks alot mate! You saved my night. Was moving a pre-production site live and BOOM everything broke. The helping part was “Do not touch icl_sitepress_settings”. Tried to search the forums but since I’m only using WPML’s free version I didn’t have access to the answers in the threads, so thanks alot for posting the solution here. Spent 4 hours before I now finally got it to work!

    Tack så mycket!


Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *