wordpress keeps redirecting on locahost when migrating from live server to localhost - wordpress

For some unknown reason my live wordpress fot blocked, showing following message on each hit
"This site has been temporarily disabled, please try again later."
So, In order to recover data I copied my wordpress site files from domain to my PC. I uploaded the database to phpmyadmin, updated the wp-config.php file for my localhost but every time when I try to hit the site from browser* i.e. "http://localhost:8080/my-site-name/" it keeps me redirecting to the url "http://localhost/my-site-name/"
*my localhost is set up to the port 8080

open database, wp_options table, find row with site_url, home_url.... it's using old value, change them with new address.

Directly copying files from your live WordPress directory and import live database into local will not work as expected.
For this you need to updated all links in you local database with
local server link (Use search in phpmyadmin for domain and replace
with local one.
You may need to updated your .htaccess file according
your local server.
For getting backup from live to local you use
plug-in like Duplicator.
Here is a link duplicator where you will find plugin for backup and restore.It backup both php files and database.so need to import db on local mysql

There is a quick hack to this also. You can create a dummy post on WordPress and publish it. Later you can delete the post. It works for me the most time.

Related

Migrating a wordpress site and getting err_connection_refused

I'm transfering a wordpress site from a previous hosting package to our inhouse servers. I've copied the whole directory and taken a .sql backup of the database. Before moving it onto our servers, I want to make sure it works by running the backup locally.
So i've imported the database and changed the siteurl and home fields in the wp_options table to match my localhost. When i go to it, I get a database error, Which is what I wanter so then I entered the correct details in wp_config
But now when I go there, I get err_connection_refused message. I've tried everything I can think of, the url is correct in the database wp_options table so its not that. Any ideas please on what to try next?
Why not leave everything as is, and edit your hosts file to point to your new machine.
Then you can test using the real URL, minimizing the risk that there are URLs in the database that you didn't edit while testing.

Wordpress Migration Issue

I have a WordPress site that works fine on my local machine. However, when I try to migrate it to my domain (copy the files and import the DB and change the DB info in wp-config), it only shows the installer and not the site itself. Is there anything that can cause such an error?
if you import DB to server host, probably you must to change options on database tables,
Ex.: "localhost" to "serveraddress"
LOOK THIS ARTICLE:
http://torquemag.io/2016/02/move-wordpress-from-localhost-to-live-server/
Looks like your database has the localhost links in the database. There is a library to replace old links to new in your wp database.
download this Library and place it in your wordpress folder where wp-config file is placed and replace your localhost link like http://localhost/wordpress to new link http://exampledomain.com and press live run this will replace all the links in the database to new links

Error when trying to move site to local MAMP

I been a little stupid. I admit.
I just started creating and developing a new site using a live subdomain I had. So now I'm trying to move it off that live server to a local MAMP server, and then finally import it to the actual final domain.
I've downloaded all the WordPress files from the live server to the appropriate folder.
I then logged into the phpMyAdmin and exported the WP database. .zipped it and imported it into the local phpMyAdmin.
Created a new user with the db_username and db_password from wp-config.
Edited the "home" and "siteurl" in the wp_options table to http://localhost/foldername
Restarted MAMP.
But now when I point to that new local url in the browser I get an 404 Error, page not found. And all links stil points to the live domain. So content is still pulled from there and soon as I click a link.
I would grateful for any help. I'm really lost here.
It's because the data from your database is using your "live URL".
I suggest that you do the following.
Export the live "DB SQL" dumb via phpMyAdmin.
Open the .sql using any text editor (notepad++, atom, sublime, etc..)
Use search and replace. Search for the live URL (http://www.live.com) and replace it with the local URL (http://localhost/cubo/).
Import the altered .sql in your localhost via phpMyAdmin.
Go to your localhost dashboard (wp-admin).
Go to permalinks
Click "Save" to force flush rewrite.

Moving WordPress from localhost to a live server

Have successfully moved my WordPress website from my localhost to a live server but the images are not showing and some pages as well. Some pages are still showing the localhost URL while another error message am getting is "That page can't be found".
I already changed my siteurl and Home column in my database table (wp_option) to the live server, but still the images are not showing yet. What should I do?
You have to replace all localhost url in your database.
You should follow the steps below to move your database from local to live server:
Export your database to sql file
Use notepad++ open that sql file
Replace all localhost url to your live domain and save the file
Import the saved file to the live database
Note: make sure that you uploaded all the images to the live server
I would definitely recommend to use an automated plugin for the task. The one I use is Duplicator, by LifeInTheGrid. It is free and works perfectly to move a site from development to production and viceversa. Here is the link to it:
https://wordpress.org/plugins/duplicator/
I use it with all my sites and so far it has worked flawlessly.
I finally discovered a wonderful plugin that did it all.
The plugin is called Velvet Blues Update URLs .
Just Download the package. Extract it to the "plugins" folder of your WordPress directory. In the Admin Panel, go to "Plugins" and activate it.
Go to Tools -> Update URLs to use it and then tick all the boxes to replace the old URLs with the new URLs.

How to move Wordpress to another domain without the chance to make a proper backup first?

So my webhoster closed down, where I hosted my Wordpress blog. I was able to receive a zip file containing all my data. I now have a new webhoster and I extracted the zip file to its root directory.
Trying to open my website now gives me "Error establishing database connection". The web tells me it may be related to hardcoded urls in the Wordpress database, which I need to replace by the new url.
However the tutorials usually tell you to use the Wordpress interface to create a backup of my database first, which can then be edited in tools like phpmyadmin. I can not access the Wordpress interface anymore and so far did not manage to edit the database otherwise.
I tried placing a local copy of the blog in the "C:\xampp\htdocs" folder, hoping phpmyadmin would recognize the database and allow me to edit it. Not working, maybe I am doing something wrong?
Any ideas to revive my Wordpress blog?
Cheers
Okay I think I got it working. For people having the same issue:
I loaded the database locally by copying the *.myd, *.myi, *.frm files to a new folder in my local xampp installation (e.g. C:\xampp\mysql\data\myDatabase).
I then used phpmyadmin to export this database to a .sql file.
On my webserver I then installed a fresh wordpress blog. It might be enough to copy your existing wordpress stuff, without needing to do this step afterwards, not sure.
My webhost has phpmyadmin preinstalled, so I used that to delete the fresh wordpress databases and import the .sql file instead. Now everything is in place, but since I changed my domain I need to change the URL paths in the database.
I used this script (use it by placing it on your webserver in the wordpress root folder and calling it in the browser) to do a search&replace of my old url to the new url: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
After that I only had to manually fix the path to my header image that I had edited in the past in the theme's header.php file.
Phew. Thanks for your help f00644.

Resources