In this section we are assuming you have an already configured DBeaver instance, including TNS names and all (in `/eos/project/o/oracle/public/admin/tnsnames.ora`).
For AIMS and AIMSTEST credentials check `tbag showkeys --hg aims` or `cat /etc/aims2.conf` from within an AIMS prod or test node accordingly.
For AIMS and AIMSTEST credentials check `tbag showkeys --hg aims` or `cat /etc/aims2.conf` from within an AIMS prod or test node accordingly:
```
# psql admin test credentials
tbag show aims_psqldbtest_pwd_admin --hg aims
# psql admin prod credentials
tbag show aims_psqldb_pwd_admin --hg aims
```
1. As per <https://dbeaver.com/docs/wiki/Data-transfer/> select all the tables in the prod schema and export them.
1. During the export try to look for `Exporter settings`, and change `Data rows per statement` to 1, as [Oracle will cry with multiple values per `INSERT` statement](https://stackoverflow.com/questions/17288408/im-getting-an-error-in-sql-command-not-properly-ended?lq=1).
1. Run those SQL scripts against the AIMSTEST schema. You will need to search and replace all `AIMS` schema references with `AIMSTEST`. For example, replace `AIMS.HARDWARE` with `AIMSTEST.HARDWARE`.
* Basically, select all prod tables, right-click, export data, Database type of export, next, next, next, start
* There may be some conflicts from key collisions. Delete them by hand if you want, or directly empty table data from test instance prior to migration
* You now directly use the Datebase export and make it point to the test instance. Check the "ON CONFLICT DO UPDATE SET" setting.
1. Rsync the boot directories to sync all the PXE images: `[root@aims01 ~]# rsync -arv /aims_share/tftpboot/aims/boot/ root@aimstest01:/aims_share/tftpboot/aims/boot`