Moved site from subdirectory to root of site. Theme images are still showing subdirectory in url

Moved site from subdirectory to root of site. Theme images are still showing subdirectory in url. We have searched the database and there are no instances of "/newsite/" left in them. However the theme is still showing this reference on its images. When I go into the Upfront design view and select the image it will only let me select a new image it will not let me update the URL. How can I accomplish this?

    Timothy Bowers

    Hey there,

    Hope you're well

    The first thing I'd look at is cache, any server level cache happening?

    I looked at your site and couldn't see any there.

    I'm guessing you moved all the files rather than just the index.php?

    Rather than this:

    https://premium.wpmudev.org/blog/how-to-safely-move-wordpress/
    https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    If it's not cache, and the folder is still being reference, I'd go with there still references somewhere in the DB.

    If you wish me to take a look, I'd need cPanel/PHPMyAdmin/FTP access. I can then look through the database and setup for you.

    Can you please send in:

    - Mark to my attention, the subject line should contain only: ATTN: Timothy Bowers
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include admin/network access
    - Include cPanel (I will need to look at the DB so need PHPMyAdmin or similar)
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Take care.

    Jeremy

    Thank you for the reply. We have tried the link provided https://premium.wpmudev.org/blog/how-to-safely-move-wordpress/ and the site comes up but the upfront them css is not being applied to the site at all. When we change the site address back and update permalinks the site comes back up on our subdirectory with no issues and looks fine. In order for the client to keep the site up we have to reinstall the old site to the root and that is the way we have the site now. We have tried this three different times to make sure we are following the process step by step. And each time we get the same results. With other themes we usually move all the files to the root directory and then we update all the links in the database as well as all the links in the theme. However when we try this option with your upfront theme it holds onto the original site url even when it has been moved. I have searched the entire database and have replaced all reference to the old site directory and it still will not see the site in a different directory then it was originally installed in. This is very frustrating a process that should take all of 15 minutes has now taken 5 days and still is not fixed. Any help or guidance you can give me would be greatly appreciated.

    Tyler Postle

    Hey Jeremy,

    I was the one that messaged you back through email there. I just want to be absolutely sure what you want me to try here before I go ahead and do it.

    You want /newsite moved over to the root - overwriting the existing site in the root? It's a live site, which is why I want to be extra sure you're okay with us overwriting it, in-case anything goes wrong.

    I usually use phpmyadmin, but been playing with MySQL Workbench for this - I've exported your database and ran the search and replace, just need to import it back now.

    Look forward to hearing back!

    Cheers,
    Tyler

    Jeremy

    Yes please move the upfront theme in the /newsite folder to the root. We tried and followed the direction step by step and it did not work. We can not leave the site broken so we had to move the old files back to the root. Please do what ever you need to do to get the upfront theme in the root and working properly. The client is getting very frustrated with the time it is taking. We have now tried to use your theme twice and it is not going as smoothly as we would like. We would loved to use the theme and keep using the theme but we need to be able to launch a site and move them without it taking this long. Please help us understand what we are doing wrong.

    Have a blessed day.
    Jeremy

    Tyler Postle

    Hey Jeremy,

    Thanks for your update here!

    It looks like you still have /newsite links in there. I exported your database then did a search and replace and it came up with 351 occurrences that were replaced. This is what I was searching and replacing for:

    http://www.yourdomain.com/newsite and replaced with http://www.yourdomain.com

    After doing that I tried importing the changed database; however, that didn't seem to be working for me. Is that the issue you were having?

    Try exporting the database and search and replace in a text editor, I used notepad++. Then import back.

    One thing I realized, is that if you're using this guide: https://premium.wpmudev.org/blog/how-to-safely-move-wordpress/

    and using the subdirectory to root instructions, then what you are actually doing is setting it up so your install stays in the subdirectory, but uses the root domain url. Is that what you want?

    I was under the impression you were wanting to move the whole new site to the root and get rid of the old the one completely?

    As I emailed over to you earlier, I think just using snapshot would be easier here, I used it successfully when I tested on my site a couple days ago. Here are the steps:

    1. Install snapshot on both installations.

    2. Take a snapshot of your /newsite/ include all database tables. You don't need to include the actual plugins/themes files as they are already on your old existing site.

    3. Import that snapshot to your main site via: Snapshots > Import.

    4. Now that it's imported, go to your list of snapshots and select it then "Restore"

    I can do that for you as well, will just need you to send me the WP login for both new and old site, if you want me too. make sure you send that in reply to the earlier email so it's private - if you do send it.

    Talk to you soon Jeremy!

    Cheers,
    Tyler

    Jeremy

    Thank you for the response. We have tried to do it both ways by moving the full site into the root and doing a database find and replace on all url's. And we have also tried to do the steps outlined in the link you sent as well. And both seem to have issues with the template and its css and base url. We also understand what you are saying with the plugin. However the newsite is a streamline of the old site and its content so we don't want to migrate all that data into the new site. That is why we do a complete new site in a subdirectory for the client. This theme is the only one we have ever run across this large of an issue when moving the site to make it live. Usually we do the following steps to make a site live and it works. But as stated earlier this is not working with this theme.

    1. Build new subdirectory called "td" and move all the current live site files to this directory.
    2. Login to the backend of the "newsite" change the site and wordpress url's to the root domain name.
    3. Move all files from the "newsite" directory to the root.
    4. Export db tables for new site. Do find and replace changing all urls to root domain.
    5. Import db tables for the new site to the database.
    6. Login to the new site in the root. Turn of permalinks and then turn them back on so they rebuild to the new domain url.
    7. In settings allow search engines to access the site.
    8. Review the menu to ensure the home item is not hard coded to the wrong url.
    9. Test the site functionality

    So as you can see we have tried both and neither of these options are working. This is not the only URL we are having this issue on as well.

    Tyler Postle

    Hey Jeremy,

    Thanks for your detailed reply

    Do you import the whole db or select tables?

    Reason I'm asking is because Upfront stores its data in various tables - so if you're missing any then that could be the issue. With Upfront it is best to migrate it all at once.

    Another option would be to use this plugin: https://github.com/wp-sync-db/wp-sync-db

    It allows for a more streamlined dev to live import. So, if you were willing to do the complete migration then that is another option alongside Snapshot.

    The db structure with upfront is quite unique, which is why I think you are experiencing some issues when trying to migrate it like your previous themes.

    Look forward to hearing back on this! If needed, I can also ask one of our developers on this for you.

    Cheers,
    Tyler

    Jeremy

    Tyler,

    We export all the tables with the prefix for this wordpress install. We are not trying to migrate content from one wordpress theme to another. We built a completely separate wordpress install and database. We built it in a sub directory. /newsite We followed the instructions giving to us by WPMUDEV support on how to move this site. We now have a completely dysfunctional theme live due to these db and theme issues.

    We need to know if it can be fixed and what exactly you need to fix it. Please this is a huge client for our company and having this new theme looking like it does live is really bad for us.

    Please let me know what you need. We have giving you access, we have followed the instructions. If it takes much longer we will need to take down the Upfront theme and just not use it. We love its functionality but if we can not build a site offline and move it, then it is not very useful for rebuilds. Maybe for new sites that can be built in the location it is suppose to be at in the end. Both this site and the other one Covenantministries.org we tried this theme out on have had issues when moved. I understand once we did not know how to move it, our bad, but this time we followed the instructions to a t.

    Thanks for helping.
    Jeremy

    Tyler Postle

    Hey Jeremy,

    I think I have a solution that is quick and easy

    I know you were against using a plugin earlier, but have you tried WP Sync DB?

    It makes the importing/exporting extremely easy and I tested it on my site and it worked without any problems.

    I think the issue you were having before is that you were excluding some data?

    Either way, restore both your sites back to normal then try this:

    1. Install this plugin on both sites: https://github.com/wp-sync-db/wp-sync-db and also this one if you want to include media files: https://github.com/wp-sync-db/wp-sync-db-media-files

    2. All you need to do is select "push" and fill in the url and connection key from the destination sites Tools > Migrate DB > Settings tab. Screenshot attached.

    Push it, then you're done. This plugin was designed specifically for migrating a db from dev site to live - and it works great from my testing.

    There are some options for excluding certain data too. It also finds and replaces all the urls for you.

    If you would like me to do this for you then I would be more than happy too. I would need you to send in your WordPress admin credentials for both sites through our contact form like you did before with the FTP though:

    https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me

    Subject: "Attn: Tyler Postle"
    -WordPress admin usernames
    -WordPress admin passwords
    -login urls
    -link back to this thread for reference
    -any other relevant urls

    That's only if you wanted me to do it for you. Make sure you do the restore first too.

    You can use this plugin for all your other sites too, I think it will make things a lot easier for you even on non-Upfront sites

    Let me know if you have any further questions on this. Look forward to hearing back!

    Cheers,
    Tyler

    Jeremy

    Tyler,

    Do you understand that these are two completely separate sites? One is an old site. And the other is the new site. We are not trying to migrate. We are trying to move. You keep making a recommendation to migrate data and we do not want the old data from old site to be on the new site.

    I will send you the login later today/tonight. We have removed the old site from your instructions stated delete all old files of old install. We will add the old files back. I will than give you the access.

    Thanks
    Jeremy

    Tyler Postle

    Hey Jeremy,

    My apologies, so you are wanting to keep all the files in the subdirectory and just move the url to root? Sorry, I know you tried that earlier, but I thought you were wanting to just move everything including all the files to the root.

    You're deleting the site that is in the root folder when you move the /newsite/ urls over to it right?

    Thanks for your reply - I'll keep an eye out for the access you're sending in.

    Talk to you soon!

    Cheers,
    Tyler

    Tyler Postle

    Hey Jeremy,

    As you already know from our email convo, I've moved newsite over to the root now

    Just posting here to explain what I did in-case others find this thread.

    I used the WP Sync DB plugin that I mentioned above: https://github.com/wp-sync-db/wp-sync-db

    1. Installed it on both your sites

    2. Entered the connection key and url from Tools > Migrate DB > Settings. Into the "Push" migrate field in /newsite/

    3. I checked the migrate media box as well (requires this add-on: https://github.com/wp-sync-db/wp-sync-db-media-files)

    4. Migrated DB - since the table prefix for the new DB is different than the original root sites db, I had to go into your root sites wp-config.php and change the prefix from wp_ to your new one.

    5. For some reason the media files didn't send over correctly, but that was no problem, I just manually uploaded them all from the /newsite/ directory.

    Hope that helps!

    Cheers,
    Tyler