# Please do not add or change anything below this point.
1;
```
In this configuration file you should replace a few placeholders before you can
use it. The following placeholders should be replaced:
*`OLD_HOST`: the address of the old database server.
*`NEW_HOST`: the address of the new database server.
*`SLONY_PASSWORD`: the password of the Slony user created earlier.
*`TABLES`: the tables to replicate.
The list of tables to replicate can be generated by running the following
command on your old PostgreSQL database:
```
sudo gitlab-psql gitlabhq_production -c "select concat('\"', schemaname, '.', tablename, '\",') from pg_catalog.pg_tables where schemaname = 'public' and tableowner = 'gitlab' and tablename != 'schema_migrations' order by tablename asc;" -t
```
If you're not using Omnibus you should replace `gitlab-psql` with the
appropriate path to the `psql` executable.
The above command outputs a list of tables in a format that can be copy-pasted
directly into the above configuration file. Make sure to _replace_ `TABLES` with
this output, don't just append it below it. Once done you'll end up with
something like this:
```perl
"pkeyedtables"=>[
"public.abuse_reports",
"public.appearances",
"public.application_settings",
...morerowshere...
]
```
Once you have the configuration file generated you must install it on both the
old and new database. To do so, place it in
`/var/opt/gitlab/postgresql/slony/slon_tools.conf` (for which we created the
directory earlier on).
Now that the configuration file is in place we can _finally_ start replicating
our database. First we must set up the schema in our new database. To do so make
sure that the SQL files we generated earlier can be found in the `/tmp`
directory of the new server. Once these files are in place start a `psql`
session on this server:
```
sudo gitlab-psql gitlabhq_production
```
Now run the following commands:
```
\i /tmp/structure.sql
\i /tmp/migrations.sql
```
To verify if the structure is in place close the session, start it again, then
run `\d`. If all went well you should see output along the lines of the