Migration Procedure from Pleasanter's DB from SQL Server to PostgreSQL
When migrating SQL Server data to PostgreSQL, follow the steps in the manual page
[Install Pleasanter on CentOS](/manual/getting-started-pleasanter-centos), with specific differences in the "DB Configuration" section.
・First, follow the "Database Configuration" procedure on the above page up to editing Rds.json (before running CodeDefiner).
・Enter the SQL Server connection string to /web/pleasanter/Implem.Pleasanter/App_Data/Parameters/Migration.json.
・Run CodeDefiner with the migrate option (DB is created and data is migrated. There is no need to run it separately with _rds).
Specifically, the option part of the following execution command differs.
For a new installation:
**> dotnet Implem.CodeDefiner.dll _rds**
For migration from SQL Server:
**> dotnet Implem.CodeDefiner.dll migrate**
### Notes
・This migration process can only be used for migrating from SQL Server to PostgreSQL.
・Migration is possible even if SQL Server and PostgreSQL are on different servers.
・Migration cannot proceed if data already exists in PostgreSQL due to ID conflicts.
*If data already exists, delete the database carefully (backup necessary data).
---
### 3.2 DB Configuration
Configure /web/pleasanter/Implem.Pleasanter/App_Data/Parameters/Rds.json as follows.
##### JSON
```json
{
"Dbms": "PostgreSQL",
"Provider": "Local",
"TimeZoneInfo": "Tokyo Standard Time",
"SaConnectionString":"Server=localhost;Port=5432;Database=postgres;UID=postgres;PWD=<configured password>",
"OwnerConnectionString":"Server=localhost;Port=5432;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD=SetAdminsPWD","UserConnectionString":"Server=localhost;Port=5432;Database=#ServiceName#;UID=#ServiceName#_User;PWD=SetUsersPWD",
"SqlCommandTimeOut": 600,
"MinimumTime": 3,
"DeadlockRetryCount": 4,
"DeadlockRetryInterval": 1000
}
```
- Navigate to the Implem.CodeDefiner folder and run CodeDefiner to migrate Pleasanter data from SQL Server to PostgreSQL.
***Only the following command differs from the normal .NET Core version installation.**
```
cd /web/pleasanter/Implem.CodeDefiner
dotnet Implem.CodeDefiner.dll migrate
```
---
- Run Pleasanter and confirm its startup with the following commands:
```
cd ../Implem.Pleasanter
dotnet Implem.Pleasanter.dll
```
- Access "http://localhost:5000/" in another terminal and confirm that a normal response is returned.
```
curl -v http://localhost:5000/
```
- Once confirmed, press Ctrl+C to stop.
Continue to follow the steps from "Creating a Script for the Pleasanter Service" in the following manual.
[Install Pleasanter on CentOS](/manual/getting-started-pleasanter-centos)