Papercut DB Upsizing
Papercut DB Upsizing
Upsizing to an external RDBMS is a simple process that should take approximately 15-30 minutes. The high-level steps to upsize are: 1. 2. 3. 4. Backup the existing data. Create and initialize the new database. Load the backed-up data into the new database. Restart the application.
These steps are discussed in detail below. This chapter also includes some sections that describe database specific configuration. See the section called Database specific configuration for more details.
Important
Each application server requires exclusive access to an external database. i.e. A single database cannot be shared between more than one application server. If you are running multiple application servers (e.g. a test and production instance), then each must have a separate database.
5. Change (cd) to the server binaries directory. e.g. 6. Windows: cd "C:\Program Files\PaperCut NG\server\bin\win" 7. Mac: cd "/Applications/PaperCut NG/server/bin/mac" 8. Linux: cd ~papercut/server/bin/linux-*
9. Run the following command: db-tools export-db 10. The output of the above command shows the name of the backup file created. Take note of this because it will be required in a future step.
Important
To use SQL Server you must ensure that SQL Server has the TCP protocol, and the server authentication option is set to "SQL Server and Windows Authentication".
Important
The database user created for PaperCut NG should only have minimal set of permissions required for the PaperCut application. The user should have full permissions to create/drop tables and have full access to any created tables. However, the user should not have permissions to access other databases installed on the database server.
by adding a # (hash) character to the beginning of the line. 5. Find the database connection details for the database type you require (e.g. SQL Server or PostgreSQL), and uncomment the lines by removing the # (hash) characters. 6. Set the username and password used to connect to the database 7. database.username=[your-db-user] 8. database.password=[your-db-password]
9. Set the database URL, which describes the location and connection details of the external database. See below for details of the format of the database URLs for different database types.
Important
If using Microsoft SQL Server, the username specified in the configuration settings is a SQL Server database user, not a Windows user. This user needs to be created in the SQL Server and granted full rights to the application database.
The [server] parameter is the name of the server running the SQL Server database, and must be resolvable from the PaperCut NG server. If the SQL Server instance is running on the same machine then localhost can be used. The [database] parameter is the name of the SQL Server database you created in Step 3 above. When using SQL Server instances, the instance name is specified in the connection URL as follows: jdbc:jtds:sqlserver://[server]/[database];instance=[instancename]
The [server] parameter is the name of the server running the SQL Server database, and must be resolvable from the PaperCut NG server. If the SQL Server instance is running on the same machine then localhost can be used. The [port] parameter is the port the SQL Server Express edition is configured to listen on. For more information on configuring SQL Express, please see the section called Configuring Microsoft SQL Express. The [database] parameter is the name of the SQL Server database you created in Step 3 above.
jdbc:postgresql://[server]/[database]
The [server] parameter is the name of the server running the PostgreSQL database, and must be resolvable from the PaperCut NG server. If the PostgreSQL instance is running on the same machine then localhost can be used. The [database] parameter is the name of the PostgreSQL database you created in Step 3 above.
The [server] parameter is the name of the server running the MySQL database, and must be resolvable from the PaperCut NG server. If the MySQL instance is running on the same machine then localhost can be used. The [database] parameter is the name of the MySQL database you created in Step 3 above.
Important
See the section called Configuring MySQL for specific instructions to configure MySQL.
The [server] parameter is the name of the server running the Oracle database, and must be resolvable from the PaperCut server. If the Oracle instance is running on the same machine then localhost can be used. The [port] specifies the port number that the Oracle services are listening on. By default this is 1521. The [SID] specifies the Oracle service identifier used to identify the database. The SID for Oracle Express edition is XE. E.g. for an Oracle Express Edition installation on the same server as PaperCut, running on the default port and SID, use: jdbc:oracle:thin:@localhost:1521/SE
Important
See the section called Configuring Oracle (and Oracle Express Edition) for specific instructions to configure Oracle.
5. Change (cd) to the server binaries directory. e.g. 6. Windows: cd "C:\Program Files\PaperCut NG\server\bin\win" 7. Mac: cd "/Applications/PaperCut NG/server/bin/mac" 8. Linux (32bit): cd ~papercut/server/bin/linux-i686 9. Linux (64bit): cd ~papercut/server/bin/linux-x64
10. Run the following command: db-tools init-db A message will be displayed to indicate that the connection details are correct the database was initialized correctly.
5. Change (cd) to the server binaries directory. e.g. 6. Windows: cd "C:\Program Files\PaperCut NG\server\bin\win" 7. Mac: cd "/Applications/PaperCut NG/server/bin/mac" 8. Linux (32bit): cd ~papercut/server/bin/linux-i686 9. Linux (64bit): cd ~papercut/server/bin/linux-x64
10. Run the following command: db-tools import-db "backup file name" 11. This command will show progress importing the data. If no errors occurred then the application is ready to restart.