Migrating Old Wordpress to New Wordpress Server, Themes and Media Not Loading - wordpress

I have followed the following steps in migration of godaddy to Cpanel and site loads, but none of my media or themes load. I'm also not above to change theme or add new media.
1) zip old wp-content
2) export old SQL db
3) delete new wp-content,
and replace with #1
4) delete old SQL db, and replace with #2
5) update site URL in wp_options table in new SQL db
6) clear cache and
cookies and tried to load website again
I'm stuck here, and have tried many different ways of doing this, and each time exact same result where my page loads, but no media or themes. thank you and looking for suggestions.

WP uses absolute links (including the URL) for all href and src attributes, and these are saved in the database.
So you not only have to update the site URL in the wp_options table, but ALL instances of the site URL in your whole database (i.e. in all tables) before importing it (i.e. the SQL file you exported) into the new site.
This can simply be done with the search/replace function in a regular text editor (replace all).

First of all update both "siteurl" and "home" in wp_options table.
Secondly, WordPress store attached media in an separate table by full path along domain name.
You can update old domain name with new domain name through search and replace plugin.
After activating the plugin on new host. Follow method in screenshot to replace all urls in database at once.
Cheers.

Related

problem mooving woocommerce to another domain

I have a woocommerce website installed and work normally , I want to change the theme without make changes on the website so all still ( products , pages, ...etc) .
I want to copy the same website into another domain to do changes without stop my first website .
this what i have do :
1- copy all files from the old to new website.
2- import database frm the old .
3- past into the new domain all files
4- import the tables of the old database to the new database
5- change the wp-config to work with the new database
6- change the domain into table : wp_options
and i launch the new domain : the first page is ok without errors
but when i enter to preview product i have error that page dosen't exist , and all other pages the same error . can any one help me ??? any ideas ?
When moving a WordPress site a few things to make it easier.
Manually, zip up uploads/plugins/theme or if you have some crazy thing going on wp-content. Generally, nothing else needs to be moved. (this excludes things like robots.txt etc you may have to move)
After importing the DB you need to run a search and replace to swap out the domain. It is used in more places than you think.
Go to settings and re-save permalinks twice. - This fixes most issues with pages not loading/404.
There are plugins out there that make this easier.
Updraft - Don't need the paid version. Can setup new site then add files and import them.
All in One WP Migration - Haven't seen anything this doesn't move but can be slow and harder with large sites.
Plugins like All in One WP Migration or Duplicator can be helpful, but from time to time they may fail.
With AIOWM you must create a backup and a blank WP installation, install the plugin in this blank installation and import the backup. Beware that many features are paid.
With Duplicator you create a backup and an installer that you've to upload (via FTP) to the new host and there execute the installer.php script to recover the backup.
Both of them take care of the search&replace needs.
If you want to go manual, you have to copy all files via ftp, or if you've a Cpanel or similar you can upload a Zip file and then extract it via the panel (I guess you don't have the ssh access to the server).
Than you've to create a database dump via PhpMyAdmin and restore it in the new server, thank you've to change two option in the database: the site url, and the wordpress address url.
That should let you login to the website backend, but BEWARE you've to do the search and replace on your database.
To do so, easyly, you can use Better Search & Replace plugin (https://it.wordpress.org/plugins/better-search-replace/).
Guessing that http://old_domain.com is your old domain and https://new_domain.com is the new one, usually I go this way on S&R:
- Search for "old_domain.com" and replace with "new_domain.com"
- Search for "http://new_domain.com" and replace with "https://new_domain.com" if you have an active SSL certificate
Than go to Settings -> Permalink and save twice.
Everything should be fine now :)
Remember to clean every cache if you've one active.

Moving wordpress site from subdomain to domain

i want to move my wordpress site from (alpha.domain.com) to (domain.com). i have already old website on domain.com which is in php . what should i do ? any changes need to be done in database? So need your advice.
As atinder has mentioned in the comments, see here for official instructions from Wordpress.org. However, I would like to highlight the key points:
You need to move backup your files and database firstly, via cPanel/FTP/pointing the new URL to the correct directory. (this is the easy part)
Once you have moved them to the correct location, you will need to do the following to make sure that your URLs are correct:
Update Base/Site URLs
In phpMyAdmin or your preferred MySQL database manager, go to the wp_options table and change siteurl and home to your new URL. These two options would usually be the first two rows in the table.
Update hardcoded permalinks
Depending on what themes and plugin you used, you will also need to update hardcoded URLs in your posts and options. I recommend backing up your database before doing a full search and replace (to replace old url with new url), as serialized data will break if you simply do a raw search and replace.
If you are certain your database doesn't contain serialized data in wp_posts.post_content, wp_postmeta.meta_value, wp_options.option_value (simply do a search first to confirm), you may safely proceed with an SQL query as outlined here. NOTE: AT YOUR OWN RISK!! BACKUP FIRST!!
You can see this section from the instructions for plugins that will help perform safer search and replace.

Error Moving WordPress

I'm in the process of trying to move a WordPress site from "example.com/wordpress" to "newsite.com" and I've run into some considerable trouble.
I made a backup of the database and put a copy of all of the WP files onto the new host. I then tried to change the URL, but got a bunch of errors on the new page. I tried to revert back to the old site in the hopes getting everything in order again, but now everything redirects to the "new" site. My wp-config and database settings are all the same as they once were since I never deleted them off the old site. I've since deleted the files from the new site. The page is still redirecting and I can't access the dashboard login.
I'm completely at a loss right now, so I could really use some expert opinion. Thanks for any help that leads to a solution.
Old Site Link
If you have access to phpmyadmin or any interface for your database you can go into the wp_options table and update rows 1 and 36. As jogesh_pi mentioned, the base url of your site is stored there, so you will need to update the database with your new path.
You can run this query in phpmyadmin and it will do it for you. Obviously replace the newsite url with your own.
UPDATE wp_options SET option_value = 'http://www.newsite.com' WHERE option_name = 'siteurl' OR option_name = 'home'
You need to run a database query that updates all instances of your old URL with your new URL. The process is explained in detail in the Wordpress Codex.
I like to use this very useful PHP script for running the database update automatically as it takes into account serialized strings which in certain cases can break widgets or plugins if they are not addressed.
I always run into this issue, I use this plugin now to transfer wordpress sites: http://wordpress.org/plugins/duplicator/
But heres a quick fix:
Login to phpmyadmin, go to your database
Go to wp_options
Change these two options to your new url where my url's are the old ones:
If your wp-content folder is of the old site contents, it should pick up. But if your images dont show, use a URL changer plugin like this one: http://wordpress.org/plugins/velvet-blues-update-urls/
it's just a simple query that helps you to transfer your wordpress site from old to new.
update wp_options set
`option_value` = replace(`option_value`, 'example.com/wordpress', 'newsite.com');
beside this make sure about the file permissions and the database is same that you have used in the old site.

Wordpress pages won't load after hosting transfer

I've just transfered a wordpress website to another domain.
For the transfer I've made the following steps:
Copied db and changed domainnames (http://olddomain.com to http://newdomain.com)
Imported db on new host (via phpMyadmin)
Changed wp-config to match new db settings
uploaded all wp files
So the homepage works, but I can't visit the other pages. However, they are showing up in my admin page.
The way I've done this in the past and have worked for me:
1- Export db from phpMyAdmin, then replace in the .sql file all references to old domain.
2- Imported db on new host (via phpMyadmin)
3- Changed wp-config to match new db settings
4- Uploaded all wp files
5- Regenerate .htaccess file, if you are using permalinks.
(you can do this the way #Riboflavin suggests)
Also, here you can find some additional information that could help:
http://codex.wordpress.org/Changing_The_Site_URL
If you are using permalinks you will need to regenrate them after the transfer. Go to Settings → Permalinks in your admin panel and choose the permalink option you would like to use and click Save Changes. This will regenerate the permalink portion of your .htaccess file for your new domain.
Are the links to those other pages still pointing to the old domain?
If so, you could try the Velvet Blues Update URLs plugin to update all the links in your site.
I've used this successfully in the past, but recommend that you back up your data fully before trying it yourself.
The fastest transfer from my experience is through cpanel using fantastico or something that installs wordpress quickly. The process is as following:
Install wordpress on new hosting through fantastico or similar app
Delete everything in installed directory except for wp-config
Copy everything from old wordpress data, except for wp-config
Paste/transfer all that data to the new host
Now export old database and delete tables on the new one then import from old db
Change site URL within database to new one
Using fantastico helps in setting up databases quickly and wp-config. No need to do it manually and waste time. Just make sure to leave the installed one and not transfer the old one.
The whole process takes me like 2-3 minutes, I think its the fastest once you get it.
You need just to adjust your new .htaccess by regenerating it
go to WordPress dashboard
Settings > permalinks
then save modifications
if it's work then well done else you need to manually change it :
you will find the .htaccess content after saving modification in permalinks page copy the contents and create the .htaccess file in the root directory

WordPress - moving from one host to another

I am trying to move a WordPress installation from one server to another one, including all of the SQL data, and the file-system data (photos,template files).
I just have a problem changing the URLs in the database, since I need to replace the new URL with the old one.
I would love to have some suggestions about how can I replace the URLs (maybe there's a rplace statement in SQL?)
Thanks in advance.
Edit 5/16/2015
It's much better to use interconnectit.com WordPress Serialized PHP Search Replace Tool to find/replace URLs in the database and to correctly deserialize/reserialize that data. Doing a find/replace in a text dump or with the UPDATE queries below will break serialized data.
Several easy ways: How to Move WordPress Blog to New Domain or Location » My Digital Life:
UPDATE wp_options SET option_value = replace(option_value,
'http://www.old-domain.com', 'http://www.new-domain.com')
WHERE option_name = 'home' OR option_name = 'siteurl';
and others:
How to Find and Replace Text in WordPress MySQL Database using SQL When Changing Domains » My Digital Life
Search RegEx « WordPress Plugins for grepping through posts and pages as a WP plugin-based way to replace image and other URLs in posts and pages.
And there's Moving WordPress « WordPress Codex.
One thing to be aware of is that WordPress stores some of it's data using serialised arrays (some plugins in particular, such as cforms, do this).
In instances where the site URL data may be serialised, simply updating the site URL text can change the length of data in the serialised string, corrupting the data and breaking things.
Interconnectit have a php script that takes serialisation into account when doing a search replace in the WordPress database. Github repo of the script here.
I have used this script in numerous WordPress migrations and it has been a lifesaver for me.
You could simply dump the mySQL in a flat file and open it up in your favorite editor. Than do a find and replace for fully qualified domain name if you are literally change domains. That should take care of WordPress specific URL settings as well, so all your links in pages, posts, sidebars etc. will work. Also be sure to change the local path's recorded in the DB to reflect what the new ones will be as well.
Once your done import the mySQL file in to the new DB and have at it. If something when wrong in transit than you'll definitely know. :)
There is indeed a REPLACE() function in MySQL, but I would recommend doing what hsatterwhite suggests and editing the whole MySQL dump as a flat file before re-importing, not least because the REPLACE() function is case sensitive.
This is a really straight forwarded procedure with no frills but extremely detailed for newbies
Make a full wordpress backup from your local server/host using cpanel. (wp + db)
download the backup1.tar.gz generated
Install a new wp site (default theme) on the target host. Same release, please!
warning: If they are different, leverage both releases.
Make a full wordpress backup from your target host using cPanel. (wp + db)
download the backup2.tar.gz generated
Additionally backup (export) wp-admin and wp-users target mysql backups; save them for future use ahead.
enter target host cPanel > file Manager > enter wp diretory > clear all files
upload local host wp backup1.tar.gz files to target host wp directory > extract files
copy wp-config.php file from backup2.tar.gz file
paste overriding wp-config.php file on target host wp directory
enter target host > cpanel > phpmyAdmin > find mySQL BD name of your target wp host and drop all tables.
restore (import) local wp using backup1.tar.gz softsql.sql file to mySQL db on target host
drop wp-admin and wp-users tables after restore. Restore (import) wp-admin and wp-users you saved before. This will guarantee target wp authentication when entering target host wp administrative tasks.
test target host wp url
The wp-config.php copy/paste is to restore target host wp and
mySQL original authentications.
Test target wp at /wp-admin mode.
that's it! Enjoy.
I think the guy is talking about hard links in his page/ post content. You need to apply #markratledge MySQL replace function link this...
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
This will replace all the links in you post/ page content...

Resources