I am scratching my head, and wonder what I'm missing here. I have done this kind of cloning lots of times, and never had an issue before. I am a Linux systems administrator by trade with significant exposure to Wordpress, but not a Wordpress expert.
I have attempted to clone a specific wordpress site (I've tried it more then once, in case I made any stupid mistakes), but I can't get it working. I have
- Dumped DB from old site.
- Copied files from old to new site, and updated file permissions.
- Done a global URL search on replace on the database for the domain name in question.
- Done a global search and replace on all files for the domain name in question
- Modified wp-config.php appropriately for the new DB and loaded it in.
- Checked, double checked, triple checked the above. Also checked for path related problems. Can't find anything.
- Disabled all caching I could find, including looking for caching files and plugins. Including on server and locally.
- Checked that the server I am visiting and cloning is the correct one.
The site in question uses Beaver Builder. One interesting datapoint is that on the new version of the site the menu does not work - it displays "CHOOSE MENU". When logged in and clicking on that Choose Menu icon it takes me to the main menu which is there.
I have no problem logging into the backend, and can see all the data that should be there.
If I clone the theme to a different server and keep the domain name the same (and use a hosts file) everything seems to work? The problem appears to relate to the changed URL.
I've tried disabling all the plugins (bu renaming the plugins folder). Did not make any difference.
Anyone seen something like this before? Anything I've missed?
I am scratching my head, and wonder what I'm missing here. I have done this kind of cloning lots of times, and never had an issue before. I am a Linux systems administrator by trade with significant exposure to Wordpress, but not a Wordpress expert.
I have attempted to clone a specific wordpress site (I've tried it more then once, in case I made any stupid mistakes), but I can't get it working. I have
- Dumped DB from old site.
- Copied files from old to new site, and updated file permissions.
- Done a global URL search on replace on the database for the domain name in question.
- Done a global search and replace on all files for the domain name in question
- Modified wp-config.php appropriately for the new DB and loaded it in.
- Checked, double checked, triple checked the above. Also checked for path related problems. Can't find anything.
- Disabled all caching I could find, including looking for caching files and plugins. Including on server and locally.
- Checked that the server I am visiting and cloning is the correct one.
The site in question uses Beaver Builder. One interesting datapoint is that on the new version of the site the menu does not work - it displays "CHOOSE MENU". When logged in and clicking on that Choose Menu icon it takes me to the main menu which is there.
I have no problem logging into the backend, and can see all the data that should be there.
If I clone the theme to a different server and keep the domain name the same (and use a hosts file) everything seems to work? The problem appears to relate to the changed URL.
I've tried disabling all the plugins (bu renaming the plugins folder). Did not make any difference.
Anyone seen something like this before? Anything I've missed?
Share Improve this question asked Mar 7, 2020 at 3:35 davidgodavidgo 3884 silver badges16 bronze badges 4- What issue are you having exactly? Just the menu won't show up? But everything else does? Do you have the correct URL in Settings > General > WordPress Address & Site Address (URL)? You can also try to flush your permalinks by going to Settings > Permalinks and saving a couple times. I don't see anything your missing that I can think of from your process. – RiddleMeThis Commented Mar 7, 2020 at 3:45
- @RiddleMeThis - Thanks for looking at this question. The site is a long way from working properly. I get a header which vaguely resembles the original header sans some images and the menu and some sub-pages look similar but missing stuff in header and footer (if I manually modify the URL to navigate to them, but the site is entirely broken) if I manually go to the URL. I've tried saving the permalinks a few times, no avail. Just looked at .htaccess file and can't see anything germane either. – davidgo Commented Mar 7, 2020 at 4:26
- hmmm, have you looked for errors, either in the browser's console or by turning on define( 'WP_DEBUG', true ); in wp-config.php? – RiddleMeThis Commented Mar 7, 2020 at 5:19
- @RiddleMeThis yes ! I turned in WP_debug fairly early on in trying to work it out, and looked at Apache logs as well. I also compared the html code for differences - which were significant, but not enough so to point me in the correct direction! – davidgo Commented Mar 7, 2020 at 9:55
1 Answer
Reset to default 0The solution is to change the way the database is migrated. I was dumping it, doing a search and replace and then loading the amended database. I have discovered this breaks serialization.
The solution which worked (and which I now believe is a best practice) is to dump and load the database unmodified. The use WPCLI to search and replace the links which handles serialization correctly. The syntax for so doing is
wp search-replace "https://old.url" "https://new.url"