Hello fouadhousni:
I think I can be of assistance here. I ran into the same dilemma as you. I wanted to install a copy of a site hosted on a remote server (production site) and bring it down into Local by Flywheel.
I’ve used Duplicator in the past, and had a good experience with it using a different local development application. I’ve not used UpDraft Plus before, although I’m acquainted with the product name and know that it’s in wide use.
I’m going to talk to you about my recent experience using a different site migration product; iThemes BackUpBuddy (BUB) (https://ithemes.com/purchase/backupbuddy/). I was able to successfully migrate a backup of my production site into LBF this past weekend. Bear in mind that BUB requires a paid license. I think a single-site license is $80/year. I just bought a 10-site license for $100. The company often offers up to 35% discounts on multi-site license purchases. So the unit cost per active license is actually quite reasonable. The upside of using this product is it’s in regular development and well-supported.
Local is different than other local development environments you may have used previously. It runs in a contained environment (using Docker) within a virtual machine (Varying Vagrant Vagrants) on top of (separate from) your operating system. That allows each site created in Local to run an entirely different server setup.
BUB creates a backup archive of site files and database. It also generates a PHP migration script called ‘importbuddy.php’. When using BUB, one must delete all the existing WordPress files in the target site before before starting the migration process.
Let’s assume you’ve made a backup of your remotely hosted site with BUB, and downloaded the archive and importbuddy.php to your computer’s Downloads directory.
Create a new site in Local. Then create a new project in your integrated development editor and link the project to the WordPress files in your newly generated site. (I use PHPStorm as my IDE. Use whatever you’re comfortable with).
Open the front end of your newly created site from Local in your browser.
Then go into your project in your IDE and delete all the WordPress files within your project root directory ( ‘/{name-of-project}/app/public/‘ ). DO NOT DELETE THE DATABASE. [I think it’s named ‘db.php’.] You’ll need to overwrite the DB using importbuddy (IB). Add in the BUB archive file AND IB to your project root directory.
Open the browser tab that points to the Local site installation (e.g. {my-local-site.local} ). Add the term ‘/importbuddy.php’ to the URL. For example, ‘{my-local-site.local}’ becomes ‘{my-local-site.local}/importbuddy.php. Refresh the browser to run the script.
IB will open the archive zip file in the IDE. In the browser, you will be prompted for your IB password. Make sure if using BUB that you’ve saved this PW in a PW manager (I store my PWs in LastPass. Use whatever you’re comfortable with.
Then it’s just a matter of following the screen prompts for BUB. Step 3 is the trickiest of them all. The DB settings for the archive zip file will be shown. You’ll be prompted to either reuse those DB settings, or assign new ones. Just enter the DB settings set by Local (e.g. DB_HOST => ‘localhost’; DB_NAME => ‘local’; DB_USER => ‘root’; DB_PASSWORD => ‘root’). You can either accept the value for the DB $table_prefix variable from your imported site, or assign a different one (e.g. ‘wp_’ ).
There’s a checkbox to drop existing DB tables from the Local database, and overwrite those tables with new tables from your imported site. Select the checkbox to enable the feature.
If the DB migration proceeds smoothly (it should go quickly), then you’re home free and the migration will proceed.
When you complete the migration and look in your project files, you’ll see that BUB unpacked all of the WP files from your archive zip package.
Word of caution: Duplicator may alter your site’s .htaccess file. That file is relied upon by the Apache web server to build your permalinks. If you get some weird error messages from BUB during the DB migration, go look in your IDE at the .htaccess file.
If you need to rebuild that file, go to the WordPress Codex and search on ‘htaccess’ (https://codex.wordpress.org/htaccess). Copy and paste the code for that file into your .htaccess file.
Drop any versions of .htaccess that Duplicator might have generated from previous migrations (they may have extensions added to them like ‘.orig’). Just delete those file copies as you won’t need them for your local dev site.
Hope this helps you, or someone else reading this.