Migration from PostgreSQL database to PostgreSQL database
Please follow the steps below to migrate data from your existing Exchange Reporter Plus database, which has a PostgreSQL database, to a new installation that has a PostgreSQL database.
- Stop Exchange Reporter Plus (click Start and search for Exchange Reporter Plus. Click Stop Exchange Reporter Plus).
Note: In case you have installed Exchange Reporter Plus as an NT Service, stop the service by clicking Start > Run, type services.msc, and click OK. In the Services window, locate the service named ManageEngine Exchange Reporter Plus, and stop it.
- Download this zip file and extract it.
- After extracting the zip file, copy and paste the pgsqlnew folder to <installation_dir>. Navigate to the <installation_dir\bin> directory and copy over both initpsqlnew.bat and setvcommonenvnew.bat from the extracted zip file.
- Go to <installation_dir\bin> and run initpgsqlnew.bat. Once it has completed, run startDB.bat from the same directory.
- Navigate to the <installation_dir\pgsqlnew\bin> directory using the Command Prompt and execute the command given below:
pg_ctl.exe -D ..\data -o "-F -p 33322" start
- Go to <installation_dir\bin> and run ChangeDB.bat. When asked, provide a database name of your choice, the username as postgres, and the password as Stonebraker.
- After the process has completed, run stopDB.bat from the same directory and close the console.
- Navigate to the <installation_dir\pgsqlnew\bin> directory using the Command Prompt and execute the commands given below:
- psql -U postgres -h 127.0.0.1 -p 33322 -d erp
- CREATE USER exchangereporter WITH PASSWORD 'AdmanUser@123$'
- ALTER DATABASE erp OWNER TO exchangereporter
- ALTER USER exchangereporter WITH NOSUPERUSER CREATEDB REPLICATION
- GRANT postgres TO exchangereporter
- Navigate to <installation_dir\conf> and open customer-config.xml with Notepad++ . Change the value of the StartDBServer parameter to true.
- In the same directory, open database_params.conf with Notepad++ and change the value of the username parameter to exchangereporter.
- Navigate to the <installation_dir\bin> directory using the Command Prompt and execute the command given below:
encrypt.bat AdmanUser@123$
- Navigate to <installation_dir> and delete the pgsql folder.
- Rename the pgsqlnew folder to pgsql.
- Restart the product. Check if all the configurations and data from the old Exchange Reporter Plus instance have successfully migrated to the new one.