Loading SQL Ledger
From LinuxServerTech
How to convert from previous version of SQL-Ledger
In case of conversion of SQL-Ledger to new system, following steps will be done. Note, this is not for a simple upgrade, but to actually move from one machine to another and a different version. The example below was used when converting from a Debian package (very old version) to a downloaded and installed system on new server.
- Install SQL-Ledger on new system, create a database, and a user access. In this document, the database "accounting" will be used.
- On the original system, perform a backup. Save the sql file generated to the new (target) machine. All work on source system is complete, and the remainder of the instructions should be performed on the target machine.
- Lock the system (Administrative function)
- From the command line, become the postgres user (su - postgres)
- Drop the existing database (dropdb accounting)
- Recreate the empty database with the sql-ledger user as owner (createdb -U sql-ledger accounting)
- Execute psql ash the sql-ledger user, inputting the file generated in step 2 as input (psql -U sql-ledger accounting < filename). This will generate a long list of messages as the database is being loaded.
- From the web interface, with the database still locked, enter PG Database Administration
- Select Update Data Set. If more than one dataset is listed, select the correct dataset, then choose "Continue"
- Unlock the system and verify correction function.
Note: Users are not stored as part of the database. you must add users manually. Also, if any templates were modified, they must be moved. They are located in the sql-ledger root, under templates directory. On a standard Debian install, they are in /usr/lib/sql-ledger/templates/{username}. Under a "normal" install (from source), they are in installdir/templates/{username}
