Skip to content

Configuring settings and databases

Jelle Siderius edited this page May 21, 2022 · 3 revisions

Configuring settings

While using the import functionality, the tool uses database and url data from the .env file.

In the file config/settings.json you can find the settings that will be used for the tool. This file must contain the following placeholders:

  • databaseLocation is full path to a folder where the database will be downloaded, if import functionality is not used. (Required)
  • keyLocation the full path to your SSH private key. If empty, sw-db-sync tries to find the SSH key on your machine by a default path. (Optional)
  • passphrase is needed if your SSH key has a passphrase (Optional)
  • adminUsername is used when configuring a default admin user & dummy customer (Required for import)
  • adminPassword is used when configuring a default admin user & dummy customer (Required for import)
  • adminEmailAddress is used when configuring a default admin user & dummy customer (Required for import)
{
  "general": {
    "databaseLocation": "/Users/{username}/Databases"
  },
  "ssh": {
    "keyLocation": "{full path to SSH key folder}",
    "passphrase": "{optional passphrase for SSH}"
  },
  "shopwareBackend": {
    "adminUsername": "admin",
    "adminPassword": "Password1!",
    "adminEmailAddress": "[email protected]"
  }
}

Configuring databases

in the files config/databases/production.json and config/databases/staging.json all the databases are configured. These files must contain the following placeholders:

  • username-1-placeholder can be replaced with a name by choice, this is used as a key for the tool (Required)
  • username is the ssh username to log in to the server (Required)
  • password is the ssh password that goes with the ssh username. (Optional if there is no password required for the SSH user)
  • server is the server(host) to log in to (Required)
  • domainFolder is domain folder on the server. This can be overwritten by using externalProjectFolder and specifying it's full path to the root of Shopware 6. (Required)
  • port the server port (Required)
  • externalProjectFolder is the external Shopware 6 root folder (Optional)
  • externalPhpPath is the PHP path on the server, use this if the logged in user has a different PHP version than the server's PHP version (Optional)

The config/databases/staging.json or config/databases/production.json file has to look like this:

{
    "databases": {
        "username-1-placeholder": {
            "username": "example1",
            "password": "",
            "server": "example1.io",
            "domainFolder": "example1.io",
            "port": "2222",
            "externalProjectFolder": "",
            "externalPhpPath": ""
        },
        "username-2-placeholder": {
            "username": "example2",
            "password": "",
            "server": "example2.io",
            "domainFolder": "example2.io",
            "port": "2222",
            "externalProjectFolder": "",
            "externalPhpPath": ""
        }
    }
}