Migrating a wordpress site and getting err_connection_refused - wordpress

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.

Related

Migrating live wordpress to local xampp error

I tried to follow this tutorial on how to migrate a live wordpress site to localhost.
I was semi-successful in that when I open the site locally, it appears to be the exact replica of live site.
However, I encountered two issues.
1) When I try to log into wordpress dashboard on local host, it takes me back to live-server dashboard
2) When I click anywhere on the local site, it takes me back to the live site.
Any advice would be appreciated as I have been trying to migrate the site for weeks now,
Thanks
Most likely the problem is that your database needs updating to reflect the URL change. Via PHPmyadmin, find your database, go to wp_options and update "siteurl" and "home" to reflect your local URL.
A alternative to solve the problem is to export the local database with phpmyadmin in an ascii file and with Notepad++ "Search and replace" fix the urls to show the local host.
Amother alternative it whould be, if you have small site, to usr plugin Duplicator , this produce 2 files an install.pho and a zip. You must take the export from web and then erase tle local and rectreate runing http://localhost/mywp/installer.php. This procedure is going to make everything auto.

How to change Wordpress site URL when migrating site to/from another server?

I have a Wordpress site that is currently running at www.example.com, hosted on a shared hosting environment. I am moving it off of this shared server, onto a cloud VM platform where I will be running a web server to host the site.
So far, I have copied the wordpress directory into /var/www/ on the new server, and configured Apache to point to /var/www/wordpress. I also created a copy of the Wordpress database from the old server, and imported it into mysql on the new server.
Before transferring the DNS for www.example.com to point to the new server, I want to make some changes to the copy of the site on the new server, using the IP address of the new server to access the new local copy, instead of the domain name www.example.com (I want to keep the original site running on the old server in the meantime, so that there is no downtime).
But after copying everything over, I cannot access the site on the new server, because the site URL is still set to www.example.com internally, so when I type in http://215.15.7.100, I just get redirected instantly to www.example.com (the existing live site on the shared server).
I have tried to follow the Wordpress instructions at Changing the Site URL, but they are incorrect or missing something. I did as suggested there and added the following to my wp-config.php:
define('WP_HOME','http://215.15.7.100');
define('WP_SITEURL','http://215.15.7.100');
... but this had no effect. It still automatically redirects me to example.com.
I also tried updating the wp_options table in the MySQL database, to change the siteurl and home settings. To do this, I ran the following queries:
update wp_options set option_value = 'http://215.15.7.100' WHERE option_name = 'home';
update wp_options set option_value = 'http://215.15.7.100' WHERE option_name = 'site_url';
... the fields were updated correctly in the database, but again, it has no effect and the site still redirects me instead of using this value.
The documentation mentions a variety of other suggested methods, with no discussion of when each is desirable to use. But at this point, I don't want to keep randomly trying things that don't work, because I don't want to mess things up.
How do I change the site URL so that it won't redirect me, and will instead just use the server IP as the base URL?
In this case OP needed to clear his own cache, so do a hard refresh or reset your browser first, then any caching plugin you may be using.
If you still are having issues with something like this, go through the following steps.
Go into phpmyadmin (make sure you are looking at the right database!), and double-check that the entries in wp_options (you might have other prefix), siteurl and home cells say what you want them to say. If no, you can edit them straight through the phpmyadmin gui, instead of using SQL commands.
Make sure your wp-config.php file on FTP/file server is hooked up to the correct database, with the correct user and password. Also check that the prefix matches the prefix of the database.
If you have access to the backend of Wordpress, refresh your permalinks, by switching forth and back to a new url structure, and back to your usual one.
As a last effort, try backing up all your plugins locally, and then deleting them from the WP install, in case you have some sort of redirect on top of the usual base-wordpress install.
The next steps are to check your theme or theme settings, or to start looking at DNS-redirects set up with your domain-host but that is a big and hairy world, and a bit outside the scope of your question.

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

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.

Website keeps going to http://MyWebsite.com/wp-admin/setup-config.php

My website keeps going Website keeps going to http://MyWebsite.com/wp-admin/setup-config.php. Can you help? Thank you
If WordPress can't find the tables in the database, it will be redirected to the setup process. This usually occur when you transfer the website to another host and the prefix is different. Check your wp-config.php for the table prefix to see if it matches what's on the database.
.htaccess doesn't have anything to do with this. If your site was running before and you're suddenly gettting the Install screen, your database details in wp-config.php have changed, such as the database name and/or table prefix. Check those. You are connecting to the database, as you're not getting a database error. But your table prefix or database name was changed.

wordpress not opening after importing database

well I have a little experience and read all the articles here about moving a site from one server to another
I uploaded the files and linked them to empty database and it works fine and ask me to install wordpress
but when I import the old database to the new empty one, the site doesn't open and keeps loading, all pages with wp-admin the same doesn't open
I think that mysql version has something to do with that, because the new server has an old version 5.1, and the old server where the database was exported from uses 5.5 version
any solution plz?
MySQL is one probability and other probability is issue in your wp_options table. Change site_url and home to match your configuration on the new server.
You may also need to change wp-config.php file to match configuration of your new server. If everything is alright, you should be able to logon to WP-Admin. Once you have logged in successfully, change Permalinks to some other structure and then revert back. This will create all URLs again in MySQL Database.
It turned out to be the openbasedir function, I allowed it and that solved the issue.

Resources