Déplacer dupliquer l’install WordPress

Dans le but de tester la MàJ du thème elegantthemes utilisé

Goal is to test the new Theme release of “the Professional” from elegantthemes that Is used by a client on both intranet and internet public website.

Previous webdev did lots of mods in the theme files with no child-theme

A new ‘v3′ version is release and solves a thimbthub security issue.

A) Quick and very dirty method.

Export sql (phpmyadmin will do it for you) – no zip.

Open the sql file, do a search and replace like for example :

http://www.myblog.com => http://webdevvm/blog

But you may gonna face a serious probleme as some SQL datas are serialized, so It will most likely bug you out.

B) Cleaner method.

  1. Export sql (phpmyadmin will do it for you) – no zip
    you can use daily email backup if you have one.( unzip in that case)

  2. Open your favorite text editor

  3. Ouvrir (text wrangler, smultron, notepad++)

  4. Search for wp-options

  5. Replace “siteurl” & “home”
    par exemple : http://www.myblog.com => http://webdevvm/blog

  6. Remplace (ici site is on OVH) /homez.000/ovhclient/www => /var/www/blog

  7. Import the new sql modified via phpmyadmin in a new db (or an empty one)

  8. Copy the site on the new server (.htaccess, index.php, wp-contents, etc… aka the entire website directory !)

  9. edit config.php (database name, login pasw etc…) with the new server infos.

  10. download search-and-replace.
    It will take care of the serialzed datas “issue”
    Place it at the root folder of the website (on your new server)

  11. go to search-and-replace url
    for example http://webdevvm/blog/searchreplacedb2.php

  12. Follow instructions and run search and replace.
    In this case (I had to transfert localy an online blog to tester a Big Upgrade of the theme) I’ve runned search-and-replace 3 times :

see below results

search1: http://myblog.com

In the process of replacing "http://myblog.com" with "http://zeuserv/dclb2c01"
we scanned 22 tables with a total of 28108 rows, 11 cells were changed and 11 db update performed and it all took 9.075779 seconds.

search2: http://www.myblog.com

In the process of replacing "http://www.myblog.com" with "http://zeuserv/dclb2c01"
we scanned 22 tables with a total of 28108 rows, 11529 cells were changed and 7252 db update performed and it all took 14.012362 seconds.

search3: webdevvm/blog/wp-content

In the process of replacing "webdevvm/blog/wp-content" with "zeuserv/dclb2c01/wp-content"
we scanned 22 tables with a total of 28108 rows, 12 cells were changed and 10 db update performed and it all took 8.930575 seconds.

I still had to cheat :

for /homez.000 from ovh aka the path of the site to replace with the path of the new site

Maybe some other things I’ll discover later on. But it mostly to test the new theme so I won’t go deep on very old posts anyway.


For a simple change,
for example :
– moving from www.mysite.com to www.myothersite.com
– and if you are on the same server
then search-and-replace will be easier for sure.

  • For now, all seems fine. If I find some pb, then I’ll do a search and replace once again with new requests. Beside some images that were themselve imported from dotclear to wordpress long long time ago, all seems fine.

  • Why all this for a simple theme ?

As I said above,
– The theme has been very modified by previous webdevs.
– The theme quite abandon timthumb ( that we regularly had to update changed hack, independently from the theme)

  • We just can’t test on production website/server don’t we?
    but still we need equivalent config to test, and if possible a quite clone of the production server. (and no, there is still no version control yet)


Don’t forget user:group right permissions www-data on a debian

Edit 20121106

Since then, all dev and staging is with git, and on a dedicated old PC under Debian to reflect ovh server.


Product and graphic designer turned to be a Mac SysAdmin.

Posted in Design, Development Tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>