This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Copy Trends
#1
Hi, Is there any way to export trend logs from a LM and import them to another one? I mean exiting data and trend config.
Reply
#2
1. Make a backup on destination LM in case something goes wrong

2. Make a backup on source LM

3. Open the backup archive using 7-Zip (https://www.7-zip.org/) and extract storage/db/current.db

4. Open current.db using DB Browser for SQLite (https://sqlitebrowser.org/)

5. Open File > Export > Database to SQL file...

6. Click "Deselect all" then select only trends table

7. Check "Keep column names..." and select "Export data only"

8. Save the file as trends.sql and open it in any text editor

9. Remove first and last line ("BEGIN TRANSACTION;" and "COMMIT;")

10. Wrap each line starting with "INSERT" like this:
Code:
db:query([[INSERT INTO "trends"...]])

11. Delete all trends on destination LM

12. Copy the whole trends.sql file contents and run it as a script on destination LM

13. Refresh the UI and make sure that trends list hes been updated

14. Make a new backup on destination LM

15. Using 7-Zip copy storage/db/trends from source LM backup to destination LM backup

16. Restore the modified backup on destination LM
Reply
#3
(30.08.2024, 06:34)admin Wrote: 1. Make a backup on destination LM in case something goes wrong

2. Make a backup on source LM

3. Open the backup archive using 7-Zip (https://www.7-zip.org/) and extract storage/db/current.db

4. Open current.db using DB Browser for SQLite (https://sqlitebrowser.org/)

5. Open File > Export > Database to SQL file...

6. Click "Deselect all" then select only trends table

7. Check "Keep column names..." and select "Export data only"

8. Save the file as trends.sql and open it in any text editor

9. Remove first and last line ("BEGIN TRANSACTION;" and "COMMIT;")

10. Wrap each line starting with "INSERT" like this:
Code:
db:query([[INSERT INTO "trends"...]])

11. Delete all trends on destination LM

12. Copy the whole trends.sql file contents and run it as a script on destination LM

13. Refresh the UI and make sure that trends list hes been updated

14. Make a new backup on destination LM

15. Using 7-Zip copy storage/db/trends from source LM backup to destination LM backup

16. Restore the modified backup on destination LM

It works prefectly! Thanks!
Reply


Forum Jump: