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.
Export sql (phpmyadmin will do it for you) – no zip
you can use daily email backup if you have one.( unzip in that case)
Open your favorite text editor
Ouvrir (text wrangler, smultron, notepad++)
Search for wp-options
Replace “siteurl” & “home”
par exemple : http://www.myblog.com => http://webdevvm/blog
Remplace (ici site is on OVH) /homez.000/ovhclient/www => /var/www/blog
Import the new sql modified via phpmyadmin in a new db (or an empty one)
Copy the site on the new server (.htaccess, index.php, wp-contents, etc… aka the entire website directory !)
edit config.php (database name, login pasw etc…) with the new server infos.
It will take care of the serialzed datas “issue”
Place it at the root folder of the website (on your new server)
go to search-and-replace url
for example http://webdevvm/blog/searchreplacedb2.php
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
Completed 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.
Completed 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.
Completed 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
Since then, all dev and staging is with git, and on a dedicated old PC under Debian to reflect ovh server.