Best way to import WordPress website for development
See original GitHub issueIssue Description
I really like working on WordPress using 10updocker in my Windows 10 machine as the local environment for WordPress, is very fast compared to other development solutions in windows
I want to know about the best method to import a currently live website for local development using 10updocker.
What I have tried?
- Creating a backup package and downloading the file
- Creating a new environment using
10updocker create
- After creation deleting all the content of
C:\Users\NardDog\wp-local-docker-sites\site-test\wordpress
- Pasting the package file of duplicator there
- Visiting
site.test/installer.php
to start the installation which then extracts the archive of file and imports the database.
Issue : When I reach the step of extraction of archive a
504
error occurs. I was not able to fix this error and complete my Import.
- Creating a backup file (
backup.wpress
) and downloading the file into the local system - Creating a new environment using
10updocker create
- Logging in inside the
wp-admin
and installing All in one WP Migration plugin again - Upload the file and restore.
Issue : The restoration for a 1GB backup takes almost 2 hours which is very long time.
Questions
-
How can I fix the above processes?
-
Is there any other better and efficient way to do this?
System Specification.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
WordPress Migration: 4 Easy Methods and the Best Plugins
Log in to hPanel and go to Website -> Import Website. Under Import your website, select Choose a file to upload the previously...
Read more >Step-by-Step Guide to Migrate Your WordPress Site to a New ...
Back up your website files; Export The WordPress Database; Create The WordPress Database On Your New Host Server; Edit the wp-config.php File ...
Read more >How to Do a WordPress Migration on Your Own (With No ...
Export Files using SFTP. The next step is to migrate files from your old site to your new one. This will include theme...
Read more >Import a Site – WordPress.com Support
Import Everything. Import the content only (pages, posts, and media.) This method can be used on any WordPress.com plan including free sites. ·...
Read more >How To Migrate WordPress Site To New Host Or Server? [Free]
Migrate Guru is a WordPress plugin built for the express purpose of migrating a site safely from one host to another. It supports...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The below are the steps I take to transfer an existing live site to wp local docker where the current site doesn’t have any version control / automated way to setup. It doesn’t take long at all once you know the steps, I hope this helps.
Prerequisites
Step 1: Create a new wp site
Run
10updocker create
and answer the promptsNote: I always use http when inputting the proxy url, I always seem to have problems when mixing non-http/https (If you can’t/don’t want to generate ssl certs because of your setting i.e wsl)
1.b: WSL Users - Update your windows hosts file
When the above command completes you need to update your WINDOWS host file to add the new domain(s)
Open the following file with admin priviledges: c:\Windows\System32\drivers\etc\hosts
Add the hostnames using the following syntax:
127.0.0.1 <hostname> <hostname2>
Step 2: Transfer the live database to the newly created environment
2.a Download the database
Access the database using phpmyadmin or similar and export the tables of your database. Note: make sure you export the tables of the database not the database itself.
Download the backup to your local machine and move it to the folder where the wordpress site is stored. e.g
~/your-local-docker-folder/<site-name>/wordpress
Step 2.b Delete the tables from the LOCAL database of the site you are setting up
The database should now import successfully however any links to the site in the database will be using the live site url. To fix this you need to do a search and replace on the database to update the urls to match your test site url, to fix this run:
10updocker wp search-replace '<live-url>' '<test-url>'
example:
10updocker wp search-replace 'example.com' 'example.test'
10updocker wp search-replace 'www.example.com' 'example.test'
If your test site is using http rather than https you need to make sure you switch the site url from the https version to the http version
10updocker wp search-replace 'https://example.com' 'http://example.test'
Step3: Transfer themes and plugins
Download the ‘mu-plugins’, ‘plugins’ and ‘themes’ folders from the live site and move them to
~/your-local-docker-folder/<site-name>/wordpress/wp-content
folder.Tip: For speed compress the folders into a backup.zip before downloading then uncompress locally
Step 4: Clean up
To make sure that links work on the site work flush the rewrite rules
10updocker wp rewrite flush
and clear the cache too with10updocker cache flush
Finish
The live site should now be set up locally.
I use sage, and during development I use Browsersync and Hot Module Reload which opens the website at
http://localhost:3000/
.After every 5-10 mins I keep getting this error :
I checked the log of
global_gateway_110up/nginx-proxy
and this particular log keeps coming in red.According to me the container needs more resources because after 2 or 3 refresh the site comes up again.
How can I change configuration to add more resources?