Error Moving WordPress - 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.

Related

How to map or copy a wordpress site to a subfolder in an existing site's route?

I have a Wordpress blog (blog.xxx.com). I have a nuxt personal website yyy.com which is hosted on aws.
Now I wish to map or migrate the Wordpress blog (blog.xxx.com) to my personal site (yyy.com/blog).
How can we achieve this? yyy.com should show my personal site and yyy.com/blog should take you to my blog.
Can I configure this in Wordpress or what else can I do to achieve this?
I tried mapping it to a new domain, but I’m not sure how to map to a particular route and get it to work when I visit (yyy.com/blog/{blog-name}.
Yes, you can set up a WP site in a subfolder of your main website. I don't recommend doing it manually, too much can go wrong. Use a plugin such as Duplicator - it's so simple to use:
Install it on the site to copy and build a package - this packages your entire website into a single zip file
Copy this ZIP file and installer.php to the the hosting new location on your hosting (e.g. yyy.com/blog)
Create a new empty database
Run the installer wizard and make sure the URL in the new settings is https://www.yyy.com/blog
That's it!
You can have the entire site set up & running perfectly in just minutes! it will even set up .htaccess correctly.
No more setting up the database, changing urls in the database, 404 errors, broken links, broken images, etc. Moving a Wordpress site manually can be tricky and you can waste hours trying to fix the issues. Even agencies use a plugin to avoid the problems.
If I understood your question correctly, you want to move your WordPress installation from blog.xxx.com to yyy.com/blog, right?
There is an official guide for this provided by WordPress: https://wordpress.org/support/article/moving-wordpress/
After you have changed the siteurl and home fields in table wp_options of your database to yyy.com/blog, you can use a plugin like Better Search Replace (https://wordpress.org/plugins/better-search-replace/) that scans your WordPress database and replaces every URL of posts etc. with the new URL of your blog.
In addition, in case of an Apache webserver you need to take care of the .htaccess file and change the RewriteBase to /blog (assuming that it was / before).
Some special plugins (for caching etc.) need some special treatment, but often clearing the cache solves the problem.
Well despite Johannes is perfectly clear for me, i'll try to simplify.
Clone WordPress files from blog.xxx.com to yyy.com/blog directory. (not sure how your server is configured, but probably you'll be able to access it.)
Clone Database to new server.
Run sql replace queries:
UPDATE wp_options SET option_value = replace(option_value, 'https://blog.xxx.com', 'https://yyy.com/blog') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'https://blog.xxx.com','https://yyy.com/blog');
UPDATE wp_posts SET post_content = replace(post_content, 'https://blog.xxx.com', 'https://yyy.com/blog');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://blog.xxx.com','https://yyy.com/blog');
update your wp-config.php to match your new database.
login to yyy.com/blog/wp-admin
go to settings and update your permalinks

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.

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

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.

Have you ever encountered Wordpress settings that wouldn't stick?

I'm in the middle of moving Wordpress from localhost on my local machine to the live web. I modified the wp_options table's siteurl and home values to point to blog.site.com/. It worked the first time I entered this url, but subsequent url entries would not display the blog page.
Is anyone familiar with this problem?
It's not really straight forward to change the URL of a wordpress site after the initial install because the database contains references to the initial url.
Have you tried following the steps outlined in these pages?
http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change
http://codex.wordpress.org/Changing_The_Site_URL
You can use this script to update the DB referees from the old url.
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Once you change the url in the wp_options table and upload the new database, make sure the first thing you do is go into the live site and set your permalinks. Even if you just go in and click save. This should update the url accordingly. However, any links in the content areas, widgets, etc. will still need to be updated manually with the new domain.
There are also some tools to help with this type of migration. Haven't tried it yet, but have heard good things about WP DB Migrate Pro

changed wordpress address to a site i dont own by accedent, recovering it

I was going through the 'settings' tab of my wordpress site and by accident i changed my WordPress Address (URL) and Site Address (URL) to a site i dont own (i accidentally put .com instead of .co.uk)
Now when i go to mysite.co.uk/wp-admin it takes me to the other site (the .com) i dont own, as you can see this is a big problem, is there a easy way i can get back into wp and change this back over ?
is there somthing i one of the wp-config.php files i could download edit and upload again, or a part of a db table i need to update ?
When I developing a site it I do it on a test server and then push to the live server. To do this I change the two fields in the mySQL database. In phpmyadmin you can change the wordpress options.
wp_options table
edit the siteurl option.
and any other instances that you want to make sure are correct.
The following query should find them.
SELECT * FROM wp_options WHERE option_value LIKE '%mysite.com%'
Then edit those files, be sure to make a backup of your database before you do that. It should work but at times changing the database like that might affect things in your menu or else where on your site. It should fix your oops and allow you in to make things right.
Add these lines to the top of wp-config.php:
define('WP_HOME','http://mysite.co.uk');
define('WP_SITEURL','http://mysite.co.uk');
In functions.php, use these two lines:
update_option('siteurl','http://mysite.co.uk');
update_option('home','http://mysite.co.uk');
Load up http://mysite.co.uk/wp-admin, verify that you can get in, and then remove those lines from the files.
go to your phpmyadmin and select the table called wp_otions
change site url to your previous site http://mysite.co.uk.
it worked for me .
Run this query in your MySQL database, with the URL changed to your actual site URL:
update wp_options
set option_value = 'http://example.com'
where option_name in ('siteurl', 'home');
NB: assumes that your WordPress tables are prefixed with 'wp_', adjust as necessary if not.

Resources