To get the database dump into your local database via command line, do as follows, as user
For convenience and since this is just your local development DB, you might want to also specify
metasfreshand owned by the newly created role:
Note that metasfresh contains more than 1000 tables. Importing the dump might take a while.
To get the database dump into your local database via pgAdmin, do as follows:
For development purposes, you can create the role with the role privileges
metasfreshand owned by the newly created role. You can open the dialog by right-clicking on the database connection:
Make sure that the new database is owned by the metasfresh role.
If you have a docker host running locally, you can pull and run the latest metasfresh database in it.
To obtain a docker host, you can for example use our vagrant file.
See https://github.com/metasfresh/metasfresh-dev/tree/master/vagrant to get started.
In order to run the PostgreSQL server inside your local virtual machine and access it, you can edit the vagrant file and add a “forwarded port mapping”. To do this, find the respective section in the vagrant file and add something like
config.vm.network "forwarded_port", id: "metasfresh-db", guest: 5432 , host: 5432 , host_ip: "127.0.0.1"
Once your started your local virtual machine this way and
sshed into it,
you can run
sudo docker run -p 5432:5432 -t metasfresh/metasfresh-db
To get our latest metasfresh-db and start it up.
This section describes how to update your local (developer) DB with the latest migration scripts that were just build from the master branch
You can get those migration script by downloading them as a
tar.gz file from this URL
That tar.gz contains
de.metas.migration.cli.jarwhich applies those scripts that were not yet applied against your metasfresh database
sql_remote.shwhich is just a thin wrapper around the actual tool which is in the jar
What you still need to provide is the following:
METASFRESH_DB_SERVER=localhost METASFRESH_DB_PORT=5432 METASFRESH_DB_NAME=metasfresh METASFRESH_DB_USER=metasfresh METASFRESH_DB_PASSWORD=
The values written here in this documentation are the defaults which the tool assumes if the respective value is missing.
By default, the tool will assume the settings file to be
~/local_settings.properties (i.e. usually
If you need to specify a different settings file, please run
sql_remote.sh -h and check out the help message (
Note: it might generally be a good idea to first run
sql_remote.sh -h and take a look at the help message.
When the tool runs, it scans a directory for SQL files and applies those files that were not yet recorded in the
AD_MigrationScript table of the metasfresh database.