Cloning wordpress live site to localhost (mamp) - redirect to live site - wordpress

I am new in this and I am struggling with cloning a WordPress live site to localhost for development. After reading many different tutorials, I finally succeeded to clone the live site to localhost (http://localhost:8888) but when I try to login into the WordPress admin area at first it did not open at all but after trying a few times it opened but redirected to the live site.
I changed the URLs in phpmyAdmin but I always have the message "0 rows affected". I changed the URL in wp_config.php.
define('WP_HOME','http://localhost:8888');
define('WP_SITEURL','http://localhost:8888');
After this in phpMyAdmin inside my database --> wp_options I changed the site URL and home with the new localhost URL http://localhost:8888.
Nothing of these is working. What am I missing?

I recommend to make a clone by some plugin (f.e. Duplicator). It will makes for you all of the stuff like changing the url in DB, and if is anywhere a problem it gives you error report.
You can install Duplicator, make a full copy of you website (just clicking next...next), after that download it to your PC (or devie where is localhost). After that, run the downloaded php file and complete the DB login. After that, if you have correct DB with correct login credentials you should have running website copy on localhost.
More details you could find in this video: https://youtu.be/NLYyecIXOU0

Related

Images not showing on Wordpress website after migrating to hosting provider

I recently migrated my website to a hosting provider from localhost and some of the "Featured Images" on the some pages are not showing up. I went to the Chrome Console on the computer that was having this problem and saw this error:
I see that Wordpress is trying to load the image from Localhost instead of the website. My siteurl and home options are set correctly. I have already tried deleting all the plugins but that didn't help. I also tried recreating the page on the server itself and it did not help. Can you please help?
Edit: I do see the images in the Media Library, but don't see them on the page when it loads.
Try to move your db with plugin WP Migrate DB
Upload a new site to hosting, after local development, as follows:
Copy the site folder from the local server to another location.
Export the Database to the copied folder with the site.
Using the editor (the normal editor should have a search-replacement), replace all occurrences of 'localhost/your_folder' on the site and in the database on 'yoursite.com'
Upload the site and the database to the server, respectively.

Wordpress Add "login/?msg=membershipRequired" to my URL

I have a website (built using wordpress) running in host server. I am trying to run my site in local machine. I install xampp, copy of my sites files, and export/import my database to local apache server.
However, when I am trying to open http://localhost/inj/public (/inj/public contains all wordpress files and folders), the url changes to "http://localhost/inj/public/login/?msg=membershipRequired" and the page shows "Object not found!".
I have changed my site and home url from wp-options table. But the problem is still there.
Any help?
Maybe you are using WooCommerce and have a restriction accidentally added? Have found something about it here: https://docs.woocommerce.com/document/woocommerce-memberships-settings/

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.

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.

Resources