DEV Community

Matthias Andrasch
Matthias Andrasch

Posted on

Import WordPress site into local project via DDEV + BackWPup

What is a fast way to download a remote WordPress site to your local computer in order to run it in a local instance? I currently use the following way via DDEV and the free WordPress plugin BackWPup if I need to debug a site locally in a quick way.

1. Create a new project folder

2. Add .ddev/config.yaml file and change the name::

# DDEV project configuration

# Local website will be available via <name>
name: my-new-project
type: wordpress
docroot: ""
nfs_mount_enabled: false
mutagen_enabled: false

# WebServer settings
php_version: "8.1"
mariadb_version: "10.5"
webserver_type: nginx-fpm
Enter fullscreen mode Exit fullscreen mode

The name will later be used for your local websites URL, e.g.

3. Create the file .ddev/providers/backup.yaml, copy & paste the file content from this source:

This file does the magic of importing a backup zip file into the local instance. It is a collection of commands which import the database, copies files and replace the live sites url with the local URL in the local database. This script is possible because of the DDEV feature Hosting Provider Integration.

4. Create a backup on your remote site via BackWPup plugin

5. Download the backup file and save it as in your local project folder

6. Run ddev start in your local project folder

7. Run ddev pull backup to start the import

Screenshot of terminal with ddev pull backup command

Screenshot final result CLI DDEV - success

8. Open the site via ddev launch

Happy (local) developing!


If you want to control the child theme folder in git and don't sync / overwrite these files on ddev pull backup, change the childThemeFolderName: setting in .ddev/providers/backup.yaml.

Also add the following .gitignore in the root level of your project directory and adjust the child theme folder name to your child theme (last line).

# Ignore all ...

# ... but track specific files / folders: 

# General files

# DDEV config and provider script

# Child theme:
Enter fullscreen mode Exit fullscreen mode


  • Mixed quotes like define("WP_SITEURL", '') can't be handled yet, please convert your wp-config.php to either single or double quotes

  • "Fatal error: Uncaught Error: Call to undefined function add_filter() in phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1296) : eval()'d code:182" - check your wp-config.php, maybe your webhosting provider added some incompatible add_filter(). Comment out these lines. Explaination:

Read more

Top comments (0)