V
V
Vitaly R2018-02-14 08:48:39
Apache HTTP Server
Vitaly R, 2018-02-14 08:48:39

How to move a WordPress site from hosting to a local server?

All good health. I ask you immediately, do not swear about the duplicated question, since in the question that was already asked here, I did not find an answer, and raising the old "necrotheme" will not bring results.
Actually the situation is this. Transferred my website from hosting to wordpres. I did the following:
-Install all the necessary components on the local server (Apache, PHP, Muscle and all that)
-Moved the entire public_html folder from the hosting to your server to the /var/www/moi_sait
directory -Moved the mysqldump`om database (created a new database , dumped the old one into it)
-Created in the user base as wp-config.php (password and name are exactly the same).
- Gave full rights www-data:www-data to the directory and subdirectories /var/www/
-In Apache in sites_eneble in defoult.conf I changed DocumentRoot to /var/www/moi_sait
Everything seems to be fine and should work. But only the first page works.
I open in the browser 10.11.0.153 (local server address) - the main page of the site opens. Everything cool.
Then I follow other links and it throws me to the old site that is hosted (I haven’t turned it off yet).
For example, I open "about us", it should be "10.11.0.153/about_us" and it goes to "moi-sait/about_us"
If I write "10.11.0.153/about_us" in the browser with my hands, then "Not Found
" there is a problem with links, but I don’t know where :(
Tell me, good people. What should I do?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladislav Lyskov, 2018-02-14
@Vlatqa

change domain in database

O
Orkhan Hasanli, 2018-02-14
@azerphoenix

A simple option:
- install Openserver
- create a new local "domain"
- upload the VP files there
- edit wp-config.php (change database access)
- import the site database via phpmyadmin
- open the wp-options table find 2 lines containing the site url and change to local
- open the admin panel, install the Better Search Replace plugin, check the "change GUID" checkbox, uncheck the "idle mode" checkbox and replace the old URLs with the new ones.
- Remove htaccess content. Update the permalinks through the admin panel, thereby the VI will generate a new htaccess.
- Check plugins and themes for compatibility with PHP version.

B
Boris Shpakovsky, 2018-02-15
@kotboris

I usually do this: I make a full backup of files and databases using Updraft Plus, I download files to the local area. I am restoring all these files and the database with an updraft. Then I throw this thing https://github.com/interconnectit/Search-Replace-DB into the root of the new site , I write the old domain in the first column, and the new one in the second.
It finds and replaces all references to the old domain in the database and changes it to the new one. I delete Search&Replace. Everything! This option works flawlessly and takes a minimum of time.

V
Vitaliy R, 2018-02-15
@ultrix

Campaign, I just did not do the most important thing.
When I picked up a new server, I first had to install a bare wordpress on it. Next, create a base. Connect to it through the admin panel, complete the WordPress installation. And only then upload your public_html to the newly created public_html, then dump the database from the backup and after that change the old url to the new one in the database.
I'll try this method right now.
For those who are trying to help me, thank you very much. I apologize to you, I probably did not give all the data, so I confused you.
I have a website on WordPress, over the hill, on hosting. I want to transfer it to myself on a server in the local network. inside. I decided to do it on debian, because I work with it most often. Winda, in principle, is not considered.
If anyone is really interested, I can give a teamviewer. Let's see what's what together. Completion of the problem is ready to symbolically reward. Throw on a mobile phone or transfer to a card)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question