Wordpress failing to load graphics after migrating. when I bring back the old site graphics come and everything works on the new domain - but if I delete the old domain files everything dies.
Seems like your images are still being pulled from the old website.
This happens because you didn't update your posts on the Database for the new domain.
If you have access to your WordPress dashboard, you may want to try this plugin https://wordpress.org/plugins/better-search-replace/
Search for:
olddomain.com
Replace with:
newdomain.com
Some things to consider:
As always, make a backup of your DB before you start
Don't add http:// or https:// to your search/replace strings, and no trailing '/'
Do include subdomains and/or folder if applicable (e.g. subdomain.olddomain.com/my-wordpress)
Related
After manually moving wordpress to another hosting, it can't find all the media (e.g. photos). I changed the old url in the database in wp-opitions to the new one and changed wp-config to connect to the new database.
The problem is that some images are showing up, and some wordpress can't find despite being in the same uploads directory.
When migrating, it is not enough only to change the old url to the new one in the opitions table.
You need to change it in the whole database.
The images in the text are often set not by their ID, but simply by a link.
Try to install this plugin Better search and replace and replace the domain in all records through it.
If you have access to the old site and everything works there, try to install this plugin duplicator it will pack the entire site, with pictures and plugins settings and then do all the changes in the database.
I'm working on creating a new React-based site to replace an old WordPress site. I have been creating directories within the wordpress server for the new sections I have been making. domain.org/about, for example, will go to the react files stored in the about directory. No problems there. The issue I am having now is for more complicated urls. I have set up react-router to handle lots of events by using an id to pull in information on a specific event. domain.org/events/event123, for example, should display information on event123. In development this works fine, localhost:3000/events/event123 will display event123. On the wordpress server, however, I get an error. I realize that this is because there is no event123 directory within the events directory on the wordpress server.
How can I configure wordpress to handle these urls? I realize I need to set something up so that any url that begins with domain.org/events will go to the react files in the events directory, but how I go about doing this while still passing along the event123 I do not know. Any help is appreciated. Apologies if my description is a bit confusing.
EDIT: I should add that the old parts of the site and new parts of the site have no connection to each other, other than the fact that they are hosted on the same server. Once the new site has enough content on it it will be moved to a new server and the wordpress site will be shut down.
We have a dev site www.dev.site.co.za & a live site www.site.co.za.
I wanted the dev site updated to be a current replica of the live site, so our hosting provider copied it over.
But now when if you go to www.dev.site.co.za, you are "redirected" to www.site.co.za. I have tried changing the siteurl in phpmyadmin but that hasn't resolved the issue.
Is there somewhere else the url needs to corrected and is there anything else I need to do to make sure the dev site is a completely separate environment to the live site so I can safely fiddle without damaging the live site?
wordpress not only uses the database in PHPMyAdmin for the url.
As mentioned in the official documentation there are several files that can include the url:
the wp-config.php (wordpress file)
the functions.php (theme file)
Check these and have a look for the url address.
Have a look at the .htaccess file!
Also:
Helpful for that issue (e.g. restoring a wordpress page on another server) is the plugin BackupBuddy. It is one of the most well known plugins for wordpress. (Know right now that it is a paid version! But as always there are others with the functionality).
It allows you to backup and restore your page on a new system. You can initially set your new desired address for the system then.
Maybe it is worth a look!
For rectifying your dev site issue, you can try this.
Following is the URL to a simple utility via which you can replace some value in your database with some desired value.
https://github.com/interconnectit/Search-Replace-DB
Download the utility (zip file).
Upload it to your dev site root location and unzip it there. So that the the URL of the unzipped folder becomes: www.dev.site.co.za/Search-Replace-DB-master/.
Visiting that URL will show you the screen with options to replace some values in your database with desired values.
This utility automatically selected the connected database.
Put the URL of your live site in the field to replace.
Put the URL of your dev site in the field to replace with.
Choose the Dry Run option to see what all tables and columns will be affected.
Once you see the results and know what is changing then you the click on Live Run.
Clicking on Live Run will change all the URL of your live site in dev site database with URL of your dev site.
Once the changes are done you can delete this folder.
Hope this will at least resolve the problem of redirection of dev site to live site.
Once the new site is built you can then migrate(move, copy) it to the live site's location. There are some tools out there to help with moving the site you can use once the site is done. Some require a plugin to be installed to do that though. For example magicmigration can be used to move the completed site to a new location (that one specifically doesn't take extra installs). It is also possible to manually migrate the site though depending on the situation and know-how that can be a bit much for some people.
I have a weird situation with a client:
The root directory has a custom built CMS serving the site.
They want to rebuild the site in stages as it is very big.
So they want the new site in Wordpress and for the first stage just to build specific pages in Wordpress.
So obviously I would install WP in a sub directory or a different directory than root.
BUT, they want the pages served by WP to not indicate a different URL path so if we create a page called page1 the URL needs to be:
http://domainname.com/page1 not
http://domainname.com/wp/page1
Obviously if a browser navigates to:
http://domainname.com/page1
the CMS installed in root will try to serve the page and return a 404.
So my thinking is it must be possible to add a bunch of rules in the root folder htaccess (or with PHP) that check a list if the incoming request is for a URL we indicated in the list is meant to be served from WP, then to pull the files from the WP sub directory (bypassing the CMS installed in root) and rewrite the URL to root.
So if I go with my browser to:
http://domainname.com/page1
I will get the WP page
and if I go with the browser to:
http://domainname.com/wp/page1
it will server that page but with a 301 redirect to:
http://domainname.com/page1
Makes sense? Anyone know if this is possible?
I have tried but my htaccess/apache skills are not high enough to solve this one.
Thanks
You are in a very complicated position, in one way that could be very easy if your client doesn't bother with the subfolder which is pretty reasonable and cheaper because you don't have to spend time trying figure out how to get a clean URL, instead of that you can have a semantic URL like:
http://domainname.com/page/page1
So you have your Wordpress installation in the "page" folder and everything looks transparent for the user.
On the other hand, if you what create re-directions for each page you create in the new Wordpress you can do it in the Cpanel if you have access to the server.
The problem is you have to do after a new page publication.
In terms of SEO, you are getting a Soft bounce, which is not terrible but not terrific.
when you migrate all the content to Wordpress you have to delete all those redirections and will be more work to do in terms of SEO
The bottom line is if you have enough arguments for why you client could let you do it in the easy way that can help you a lot and save a lot of time.
I am trying to make a clone of a Wordpress site into a subdirectory. So, I will have two installations, one in the root of the domain, and one in /test. My problem is that, even though I have changed the values for siteurl and home uri in database, my links will redirect to root. So, a page like domain.com/test/contact will redirect to domain.com/contact, which is not what I want.
You need to follow these steps to clone your WordPress website from production to staging server -
1. First export database of production server WordPress website and open SQL file in an text editor.
2. Then find your domain name(domain.com) and replace it at all places with your domain name/test like domain.com/test.
3. Import production SQL file to test database from phpmyadmin.
4. Open staging WordPress admin like domain.com/test/wp-admin and go to Settings > Permalink section. Just click on the Save button to update htaccess file.
5. Optionally you can go to setting at admin page and save all general settings, menus and check Widgets area too.
6. Now you can access your domain.com/test WordPress website.
Maybe is because your htaccess settings rewriterules.
Take a look to it or post it here.
Good answer, anil-meena
However these 5 steps can be done automatically with the wordpress plugin
WP Staging. I developed this plugin because the manual process of creating a clone site for testing takes too much time and is too complicated for the regular users.
So i hope it is useful for you.