I've been developing a simple web site for someone using WordPress (along with zillions of others I believe).
I've now discovered that it is horrendously awful to move it to another domain! Not only are links in WordPress absolute but there are also loads of database entries which have the absolute URL in them.
So one has to fix all the links in pages one has created *and* one has to search through the database and fix URLs there too. Aaaarrrrgggghhhh!!!!
Setting the 'WordPress Address' and the 'Site Address' on the dashboard settings page only fixes URLs generated by the code (i.e. the menu links to pages).
Apart from anything else it makes doing maintenance/development a nightmare.
Is there any way around this or is the only approach for maintenance to have two parallel sites one 'development' and one 'live' where one tries out changes on the development site and then repeats them (hopefully correctly) on the live site.
Chris Green cl@isbd.net
I've now discovered that it is horrendously awful to move it to another domain! Not only are links in WordPress absolute but there are also loads of database entries which have the absolute URL in them.
It sounds like something has been putting absolute links in the database when usually only relative URLs are used. I've moved lots of WordPress sites between domains (for work - http://www.software.coop/products/web/social/ ) and it's not been too bad.
So one has to fix all the links in pages one has created *and* one has to search through the database and fix URLs there too. Aaaarrrrgggghhhh!!!!
I think I had one move which had that problem and I fixed it by doing search and replace in mysql. Not great but it worked.
Setting the 'WordPress Address' and the 'Site Address' on the dashboard settings page only fixes URLs generated by the code (i.e. the menu links to pages).
Most URLs should be generated by the code. It really sounds like something is wrong on your WordPress. Maybe a bad plugin?
Apart from anything else it makes doing maintenance/development a nightmare.
Is there any way around this or is the only approach for maintenance to have two parallel sites one 'development' and one 'live' where one tries out changes on the development site and then repeats them (hopefully correctly) on the live site.
As far as possible, use the theme and plugin systems and try not to hack the core. Most things can be done through them.
I did hack the 2.8 core because some things we wanted couldn't be done with plugins, but kept it under git control so it wasn't too bad.
Hope that helps,
On Thu, Nov 24, 2011 at 10:43:20AM +0000, MJ Ray wrote:
Chris Green cl@isbd.net
I've now discovered that it is horrendously awful to move it to another domain! Not only are links in WordPress absolute but there are also loads of database entries which have the absolute URL in them.
It sounds like something has been putting absolute links in the database when usually only relative URLs are used. I've moved lots of WordPress sites between domains (for work - http://www.software.coop/products/web/social/ ) and it's not been too bad.
So one has to fix all the links in pages one has created *and* one has to search through the database and fix URLs there too. Aaaarrrrgggghhhh!!!!
I think I had one move which had that problem and I fixed it by doing search and replace in mysql. Not great but it worked.
Yes, I'm not *sure* that I've got any URLs in the database but I don't want to find out the hard way by things not working after the move.
I have just taken a look, there *are* absolute URLs in there, in wp_postmeta and wp_posts (not surprising since there are absolute links on the posted pages).
Setting the 'WordPress Address' and the 'Site Address' on the dashboard settings page only fixes URLs generated by the code (i.e. the menu links to pages).
Most URLs should be generated by the code. It really sounds like something is wrong on your WordPress. Maybe a bad plugin?
As far as I can see any links inserted using the WYSIWYG editor will be absolute. This is the real killer. Thus I have a set of top level pages accessible using he menu across the top of the page, these work perfectly when you change the dashboard settings. However any links you insert on the pages (using the list of pages presented to you when you use the WYSIWYG editor) have absolute URLs. Similarly links to images have absolute URLs.
Apart from anything else it makes doing maintenance/development a nightmare.
Is there any way around this or is the only approach for maintenance to have two parallel sites one 'development' and one 'live' where one tries out changes on the development site and then repeats them (hopefully correctly) on the live site.
As far as possible, use the theme and plugin systems and try not to hack the core. Most things can be done through them.
Absolutely standard WordPress version 3.2.1 with no added plugins and using a theme from wordpress.org, can't get much more standard than that!
It's fixable but I really don't like having to do this sort of thing because it's so error prone. It's so unnecessary too, the basic problem is that the WYSIWYG editor inserts absolute URLs.
On 24/11/11 10:35:01, Chris Green wrote:
I've been developing a simple web site for someone using WordPress (along with zillions of others I believe).
I've now discovered that it is horrendously awful to move it to another domain! Not only are links in WordPress absolute but there are also loads of database entries which have the absolute URL in them.
-- Chris Green
I have a web site that uses a Wordpress installation and when I want to change the path in the database I do a database dump which produces a mysql file in text form. It's easy then to do a search and replace within that text file and then clear the database and import the result.
Regards
On 24/11/2011 11:24, Barry Samuels wrote:
On 24/11/11 10:35:01, Chris Green wrote:
I've been developing a simple web site for someone using WordPress (along with zillions of others I believe).
I've now discovered that it is horrendously awful to move it to another domain! Not only are links in WordPress absolute but there are also loads of database entries which have the absolute URL in them.
-- Chris Green
I have a web site that uses a Wordpress installation and when I want to change the path in the database I do a database dump which produces a mysql file in text form. It's easy then to do a search and replace within that text file and then clear the database and import the result.
Hi Chris,
I look after several WP sites, and yes, they have absolute URLS in the database. However, moving them is not a problem, as Barry has mentioned above. That's the best and safest method, and not too onerous.
That said, WP being WP, there's always a plug-in! Maybe this one would help:
http://wordpress.org/extend/plugins/wp-migrate-db/
"WP Migrate DB
Exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer."
and:
"WP Migrate DB exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer. It is perfect for developers who develop locally and need to to move their WordPress site to a staging or production server.
It even takes into account serialized data and updates the string length values."
I found a couple more too, but as with the one above, I have never used them:
http://www.mertyazicioglu.com/projects/wordpress-move/ http://myeasywp.com/plugins/myeasybackup/
HtH!
Cheers, Laurie.
On Thu, Nov 24, 2011 at 11:24:24AM +0000, Barry Samuels wrote:
On 24/11/11 10:35:01, Chris Green wrote:
I've been developing a simple web site for someone using WordPress (along with zillions of others I believe).
I've now discovered that it is horrendously awful to move it to another domain! Not only are links in WordPress absolute but there are also loads of database entries which have the absolute URL in them.
-- Chris Green
I have a web site that uses a Wordpress installation and when I want to change the path in the database I do a database dump which produces a mysql file in text form. It's easy then to do a search and replace within that text file and then clear the database and import the result.
I've actually used the WordPress "Search and Replace" plugin to do the required changes. It's still a horrible bodge though and doing a Google search indicates that it's an issue that many people find difficult. WordPress is so user friendly and easy to use in nearly every way that not being able to migrate it easily from one domain to another seems to be a major omission.
All the other site development tools I've played with have better (if not totally transparent) ways of handling this. It never even occurred to me that when someone tried to view my WordPress site from outside it wouldn't work (because internally I see it as localhost, or chris and from the outside it's zbmc.eu). Every other thing I have running here works as well from outside as from inside once permissions etc. are set.