[Files] - Migration to another Volume

Forum rules
1. Please keep it one request/suggestion per topic.
2. Please mark the requests with the following tags:
[Startup] - issue related to the program's startup or shutdown process;
[Taking] and [Clipping] - related to acquiring/creating notes (excl. editing);
[Viewing] - related to notes list browsing and reading;
[Editing] - related to the process of editing new and existing notes;
[Search] - related to note searching and finding;
[Managing] - related to note organization and management;
[Reordering/Sorting] - related to sorting or reordering the notes list;
[Clipboard] - clipboard operations;
[Import] and [Export] - issue related to bulk notes import/export;
[Globalization] - issues related to multiple languages/cultures support;
[Files] and [Backup] - file operations,notes back-end and backup;
[UI] - UI issues which don't fall into any of the above categories;
[Other] - other issues which don't fall into any of the above categories.

Thank you!
Axel_H
Posts: 14
Joined: Tue May 09, 2017 8:43 pm
Contact:

[Files] - Migration to another Volume

Postby Axel_H » Tue May 09, 2017 9:57 pm

As a new user I looked into how I would migrate to another Volume (for example another computer or hard disk).

While moving the CintaNotes application and SQLite DB should work without problem, I would have to retarget all links to local files.
(Let us assume I keep all linked local files in a single directory with subfolders)

Example
before migration: Note 1 link to F:\\myfiles\text.txt
after migration: Note 1 link to network_path\myfiles\text.txt.

In order to speed up the relinking I wish a command to change the link of all linked files on 'F:\' to 'network_path'.

Basically this command takes user input for 'old volume' and 'new volume' and executes an SQL update on Notes:link where Notes:link begin with 'old volume'.

With the intention not to burden the GUI with such rarely used command it may be good to implement this by starting CintaNotes with parameters \SQL.txt from the command line. To the effect of executing an SQL statement in a SQL.txt file in the install directory. (This may be a bit too techie for the common user though.)
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: [Files] - Migration to another Volume

Postby gunars » Wed May 10, 2017 3:28 am

Another approach you might try is to export the notes into an xml file. You can then edit that file to make any directory or network changes you need in any editor. Finally, import the modified file into a new database.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: [Files] - Migration to another Volume

Postby CintaNotes Developer » Wed May 10, 2017 6:54 am

+1 to Gunars.
Export your DB to XML, search-and-replace the paths, then import it into a new DB on the new volume.

A bit advanced option:
If you are using NTFS filesystem, also a handy trick would be to create a directory junction to your target folder that would be inside of a portable CintaNotes folder (if you don't know how to do it, google for "how to create directory junction"). Then using XML change the paths to use relative paths like this: "linkedfiles\mylikedfile.txt". (where "CintaNotes\linkedfiles" is your junction folder). After that whereever you move your data you won't have to change the paths, only recreate the junction folder. However you'll have to take care to attach files only from the junction folder.
Alex
Axel_H
Posts: 14
Joined: Tue May 09, 2017 8:43 pm
Contact:

Re: [Files] - Migration to another Volume

Postby Axel_H » Wed May 10, 2017 10:21 pm

Thanks for the insight, guys!

For me exporting a data base and importing it again always looks a bit risky. But if it works reliably, then why not?
Only downside could be if I ever have in a note's text body a mention of that volume. For example I change path from 'C:\' to 'G:\' and have written in a note 'operating systems usually reside on C:'.

Good hint for the directory junction as well. I will try that as well.
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: [Files] - Migration to another Volume

Postby gunars » Thu May 11, 2017 12:05 am

If you want to make sure you only look at actual file links, you would need to look for a construction like the following in the body of the note:

<notelink path="cintanotes:///file/C:\temp\example\test.pdf">test.pdf</notelink>

You could then search and replace "cintanotes:///file/C:\temp\example\" with "cintanotes:///file/G:\new\path\".

If you take a sample note with the sort of links you have and export just that one note to XML, you can see how it's formatting the links.

As far as I know, importing from an XML file (that was exported by CN) should be as reliable as importing from an existing .db file. And, since you'd be importing it into a new notebook/database, the original would remain untouched.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: [Files] - Migration to another Volume

Postby CintaNotes Developer » Thu May 11, 2017 5:30 am

Again, +1 to Gunars.

XML export/import works reliably, the added bonus being that it reduces size of the database. However note that it doesn't export/import contents of Recycle Bin. Also, if you use Simplenote sync, some extra steps are needed to avoid note duplication.
Alex
gunars
Posts: 234
Joined: Fri Nov 08, 2013 5:35 am
Contact:

Re: [Files] - Migration to another Volume

Postby gunars » Thu May 11, 2017 4:16 pm

Hi Alex

What are these extra steps for Simplenote and when are they needed?

I've just started using the CN to Simplenote sync and it's working great! I had initially ignored this feature since I wasn't using Simplenote. I've now started using Simplenote only because of this feature. :-) It's an easy way for me to take some quick notes on my phone and get them into CN (or to make some CN notes available on my phone). Great feature and a simple, lightweight solution in keeping with the spirit of CN!

Gunars
Axel_H
Posts: 14
Joined: Tue May 09, 2017 8:43 pm
Contact:

Re: [Files] - Migration to another Volume

Postby Axel_H » Thu May 11, 2017 8:22 pm

Thanks Gunars,

yes, to include the field name in the search string is the way to go.

Compacting a data base by export and import- now that would have never crossed my mind.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: [Files] - Migration to another Volume

Postby CintaNotes Developer » Fri May 12, 2017 4:20 am

Gunars,

well basically CN keeps some Simplenote-related bookkeeping data that is not exported to XML.

Later when a new notebook is connected to the same Simplenote account, it can lead to note duplication.

The safe way to go about this is to export only non-Simplenote-synced notes to XML, and later get part of the notes via Simplenote sync, and the rest by import.
Alex

Return to “Feature Requests”