Wordpress cannot find all media - php

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.

Related

Wordpress failing to load graphics after migrating

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)

How do I change a wordpress dev site url that was overwritten by live site backup

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.

Moved Wordpress site and on login redirects to home page

I meticulously backed up a working WordPress site, files DB tables, the works. I moved it to a new server, got everything working, the site renders, the DB is recognized, etc.
The issue is anytime I try to log-in, after login the site always redirects to the homepage (mysite.com/index.php)
I have scoured every PHP page for text like 'site_url' and 'wp-redirect' 'redirect' looking for the offending code that will not direct me to the admin dashboard.
To be honest, I am not even sure what page the site is supposed to redirect to.
I can always reinstall, but then I'd get stuck with the daunting task of having to manually rebuild all the headers, with the images, embedded flash and the rest of it.
Since the site was working at the previous location, and not a single byte was lost on the move, with all the tables updated to show the correct server name, I am stuck on this issue.
I have looked at all the StackOverflow links related to this issue and none of them addressed my issue specifically.
WordPress never does such redirection. Some security plugin can do. To fix the issue. deactivate all the plugins, you can do this by executing following query
UPDATE `wp_options` SET `option_value` = '' WHERE `option_name` = 'active_plugins';
Once done login and activate the plugins one by one and check which one causing the issue.
I had to re-install WP altogether. Once I did that, I was able to login and see the WP dashboard.
To reinstall, I relocated all the files in the main directory and the wp-admin, wp-content, and wp-includes folder. All the other folders I left alone, because they are not affected by the WP install.
After the install, you will have to open the wp-config.php file to input the new db name, db user, db password and db host. What you will see is the WP install added a fresh set of tables in the db you named in the config file. The only folder you will then have to copy and paste is the theme folder from the old site into the themes folder in your new install.
Now that you can login (yoursite.com/wp-admin), to populate your dashboard, import all the records from the old db table into the new one (the one with the pages and posts you want). If you do that right, all the pages (and blog posts) should populate in the dashboard window.

Trouble migrating a wordpress installation

I just finished migrating a wordpress website into a new website (hosted on godaddy's managed wordpress). Here is what I did:
Exported the database using this plugin:
https://wordpress.org/plugins/wp-migrate-db/
Changed my site-url and home-url to the new ones
Did a search and replace for 'wp_' in the exported db for the correct 'wp_xxx' in production
imported the backup into prod.
copied over the entire wp-content onto the new server.
Everything worked well except for two issues that I ran into (wondering what happened):
The first issue was with the pages templates. While the pages (in
the db) and templates (in the source) were transferred just fine. I
lost the association of page -> template. I had to go in to the
production dashboard and re-select the pages' templates.
Something happened with all my media. Basically, the media files
moved over just fine to the prod server but when I go into the
wordpress dashboard > media, they all appear like gray files. Also,
I cannot add them to any posts (as featured images). However, if I
grab the media item's url and just paste it into my address bar, it
is shown just fine (which means that they are where they are
supposed to be on the server, and the server is serving them up).
I just don't understand why these issues occured. Where could I have lost information given that I moved over all of wp-content and the entire db?
Thanks in advance.

Moving old wordpress.com site stats to a self hosted blog

I recently moved my old wordpress.com blog into self hosted blog with a my own domain name. So far I have done these things.
transferred my old articles and posts.
installed and activated the Jetpack plugin.
transferred my old blog followers with the help of wordpress support team.
And now I want to get transfer my old blog site stats into new one. Is it possible to do so? At least is there a work around for that?
Thanks in Advance
According to my research, albeit not too in-depth, the vast majority of results seems to point to this not being possible.
Please see -> here <- for more information.
Good luck!
Personally I do not use Jetpack for stats but digging into jetpack it seems that the stats are transferred based on the domain name.
Reference:
http://en.forums.wordpress.com/topic/moving-jetpacked-wporg-installation-to-another-site
So technically as long as you have the same mysite.com address it should retain the stats.
As for transferring wordpress over to your own server, I have done this a couple times and the one that seems to work the best for me is this process.
From Old Server:
Export MySQL database
Copy the whole file directory
From new Server:
Install a copy of Wordpress on your server (just to create the DB and file structure)
Empty the newly created MySQL DB and import the database from the Old Server.
Copy/Replace all files from the old server to the new one except for wp-config.php (since it has new credentials)
Lastly I go into wp-admin -> Settings and save the permalinks to have it resetup the .htaccess
Hope this helps.

Categories