# How to restore DevKinsta backup?

**URL:** https://community.kinsta.com/t/how-to-restore-devkinsta-backup/2537
**Category:** Application Support
**Created:** [September 18, 2023, 11:32pm UTC](https://community.kinsta.com/t/how-to-restore-devkinsta-backup/2537 "2023-09-18T23:32:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![38South](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/38south/32/2424_2.png) [@38South](https://community.kinsta.com/u/38South)
#### Post date: [September 18, 2023, 11:32pm UTC](https://community.kinsta.com/t/how-to-restore-devkinsta-backup/2537/1 "2023-09-18T23:32:53Z")

</div>

I accidentally pulled a production site and wiped out a lot of work that I’d been doing on a new landing page. I see that DevKinsta always does a site backup before pulling from Kinsta. How might I find and restore the backup to hopefully recover my work?

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [September 19, 2023, 1:19am UTC](https://community.kinsta.com/t/how-to-restore-devkinsta-backup/2537/2 "2023-09-19T01:19:42Z")

</div>

Hello @38South Klint 👋 , and welcome to Kinsta Community!

While DevKinsta always does a site backup before pulling (syncing) from Kinsta (MyKinsta), that backup is just temporary - and it will not be kept permanently.  
The .tar.gz backup file would be created and stored inside the docker’s container “devkinsta\_fpm”, under the `/www/kinsta/temp/backup` sub-folder - then it would be deleted right away once the pulling process has been completed/done.

If you [check the **main.log** file](https://kinsta.com/knowledgebase/devkinsta/error-codes/#viewing-the-application-log-file) for that whole site pulling process, you may notice such the following in that log file, for example:

> [2023-09-19 07:19:47.716] [info] [createSiteBackup] Creating site backup for yoursitenamehere  
> [2023-09-19 07:19:47.716] [info] [createSiteBackup] Writing to /www/kinsta/temp/backup/yoursitenamehere.tar.gz

and at the end of that site pulling process, we will see something like this in that main.log file:

> [2023-09-19 07:20:05.837] [info] [containerExec] Command ‘rm -Rf /www/kinsta/temp/backup/yoursitenamehere.tar.gz’ on devkinsta\_fpm finished with exit code 0  
> [2023-09-19 07:20:05.837] [info] [deleteSiteBackup] Deleted /www/kinsta/temp/backup/yoursitenamehere.tar.gz successfully!  
> [2023-09-19 07:20:05.837] [info] [ipc/sync/pull] PULL site finished

as we can see there, the .tar.gz backup file was removed/deleted right away upon the site pull has finished.

I’m afraid if you didn’t take any manual backup of your local site in question on your local computer before, then there’s no way to restore that local site from your local backup unfortunately.

In order to perform manual backup of your local site (that may help you in the future), you can do the following.

First export your local WordPress site’s database (on a standard WP setup).

Depends on the operating system you’re using on your computer.  
If you’re using Linux or Mac, you can run the command below via a terminal program:

`docker exec -u www-data -it devkinsta_fpm bash -c "cd /www/kinsta/public/yoursitename && wp db export yoursitename.sql; chmod 0777 yoursitename.sql"`

If you’re on Windows, you can go to the Docker Desktop → Containers → click the devkinsta\_fpm container name → then click the _Terminal_ tab, and run the command below:

`cd /www/kinsta/public/yoursitename && wp db export yoursitename.sql --allow-root; chmod 0777 yoursitename.sql; chown www-data:www-data yoursitename.sql`

Note:  
Please be sure to replace the word `yoursitename` above with your actual local site name in question.

Second, once that .sql database has been created, you can then create a ZIP of your local site’s files (along with that .sql file) that are located under this sub-folder: `~/Devkinsta/public/yoursitename , from your filesystem using your ZIP tool of choice.  
Then you may want to save that .zip file elsewhere as your backup file (which contains that specific site’s files/folders and its .sql database file as well) for further usage in case you require to restore from that backup.

In order to restore that .zip backup file, you can read and follow [this article](https://kinsta.com/knowledgebase/devkinsta/import-an-external-backup/#creating-a-site-in-devkinsta) (skip the first step and start from the “_Creating a Site in DevKinsta_” section).

Regards,  
Agus

---

<div class="post-metadata">

### Author: ![38South](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/38south/32/2424_2.png) [@38South](https://community.kinsta.com/u/38South)
#### Post date: [September 19, 2023, 1:04pm UTC](https://community.kinsta.com/t/how-to-restore-devkinsta-backup/2537/3 "2023-09-19T13:04:43Z")

</div>

Thanks for the detailed response @Agus .

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/8/80f8c4e56fecc02327a0964e6bf63a716483529f.png) [@system](https://community.kinsta.com/u/system)
#### Post date: [September 22, 2023, 1:05am UTC](https://community.kinsta.com/t/how-to-restore-devkinsta-backup/2537/4 "2023-09-22T01:05:28Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
