# How Sam's Windows development environment is configured

**URL:** https://meta.discourse.org/t/how-sams-windows-development-environment-is-configured/62444
**Category:** Development
**Created:** [5월 10, 2017, 3:49오후 UTC](https://meta.discourse.org/t/how-sams-windows-development-environment-is-configured/62444 "2017-05-10T15:49:04Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [6월 18, 2017, 2:49오전 UTC](https://meta.discourse.org/t/how-sams-windows-development-environment-is-configured/62444/12 "2017-06-18T02:49:14Z")

</div>

The first error in the log (`/var/lib/dockers/containers/idhere/idhere.json`) is:

```json
{"log":"2017-06-18 02:16:36.036 UTC [2492] discourse@discourse ERROR: relation \"api_keys\" already exists\r\n","stream":"stdout","time":"2017-06-18T02:16:37.497495095Z"}
{"log":"2017-06-18 02:16:36.036 UTC [2492] discourse@discourse STATEMENT: CREATE TABLE api_keys (\r\n","stream":"stdout","time":"2017-06-18T02:16:37.510775323Z"}

```

In the restore progress window in the browser everything leading up to that looks like:

```plaintext
[2017-06-18 02:16:33] 'eli' has started the restore!
[2017-06-18 02:16:33] Marking restore as running...
[2017-06-18 02:16:33] Making sure /var/www/discourse/tmp/restores/default/2017-06-18-021633 exists...
[2017-06-18 02:16:33] Copying archive to tmp directory...
[2017-06-18 02:16:33] Unzipping archive, this may take a while...
[2017-06-18 02:16:35] Extracting metadata file...
[2017-06-18 02:16:35] Validating metadata...
[2017-06-18 02:16:35] Current version: 20170605014820
[2017-06-18 02:16:35] Restored version: 20170307181800
[2017-06-18 02:16:35] Extracting dump file...
[2017-06-18 02:16:35] Restoring dump file... (can be quite long)
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] SET
[2017-06-18 02:16:36] ERROR: relation "api_keys" already exists

```

Which is making me think, not a syntax error. That’s the first `CREATE TABLE` statement in the file. I understand that during restores there’s supposed to be some `CREATE SCHEMA` / `RENAME SCHEMA` magic that goes on (eg [Restore a Discourse backup manually for development](https://meta.discourse.org/t/manually-restoring-a-discourse-backup-for-development/33551) ), but I don’t see that in the Docker log, the less verbose on screen restore log, or inside the dump.sql file.

I thought that might be the problem, so I manually put in

```sql
DROP SCHEMA IF EXISTS restore CASCADE;
CREATE SCHEMA restore;

```

Without luck.

Is this process sound? It’s how I set things up:

```bash
mkdir /var/discourse /var/hold
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
./discourse-setup
# errored out because of mail config,
vi container/app.yml

tar cf - . | gzip > /var/hold/fresh-install.tgz

```

And then restore them between runs:

```bash
cd /var/discourse
./launcher stop app
rm -rf ./* /var/lib/dockers/containers/*
tar xzf /var/hold/fresh-install.tgz
./launcher rebuild app
mkdir -p /var/discourse/shared/standalone/backups/default
cp /var/hold/backup.tgz /var/discourse/shared/standalone/backups/default/try-begriffin-2017-03-09-145156-v20170307181800.tar.gz

```

Then I have to go into the web browser and create my admin account, enable restores, and try to restore the backup.

But that should reset everything past initial docker install, right?

---

_[View the full topic](https://meta.discourse.org/t/how-sams-windows-development-environment-is-configured/62444)._
