delphidabbler / codesnip

A code bank designed with Pascal in mind
https://delphidabbler.com/software/codesnip
Other
111 stars 34 forks source link

Old And New #12

Closed limelect closed 3 years ago

limelect commented 3 years ago

I use ver 14.15.1 for years. I downloaded 4.18.0 Portable it is empty. how do I transfer the old DataBase from old to new Also if I download to new will it erase the old?

delphidabbler commented 3 years ago

Thx for your report. Sorry you've met a problem with the update.

There are several possible causes and solutions depending on how you were using CodeSnip.

Furthermore, solutions for your own snippets collection and for the one I provide are different.

So I can diagnose what's going on I'll need some more info. So can you clarify a few points for me please?

  1. Were you using 4.15.1 portable or the standard install?
  2. If it's 4.15.1 portable did you copy 4.18.0 portable into the same directory or a different one?
  3. Have you still got 4.15.1 installed?
  4. When you say 4.18.0 is empty do you mean there are no snippets being displayed at all?
  5. I'm assuming you had your own snippets stored in 4.15.1. Is that correct?
  6. Were you also using my Code Snippets Database?

Once you get back to me with the info I'll try to come up with a solution.

Regards Peter

limelect commented 3 years ago
  1. Were you using 4.15.1 portable or the standard install? waaa it was long ago I guess no install may even compile. I hat installations sorry.

2.If it's 4.15.1 portable did you copy 4.18.0 portable into the same directory or a different one? No 4.18.0 is just in its own directory.

  1. Have you still got 4.15.1 installed? I am using 15 all the time. never uninstall.

4.When you say 4.18.0 is empty do you mean there are no snippets being displayed at all? yes 5.I'm assuming you had your own snippets stored in 4.15.1. Is that correct? Yes lots of them

  1. Were you also using my Code Snippets Database? yes yours and mine. at a time I used to add to yours from the net. As you changed I did not do it anymore
delphidabbler commented 3 years ago

Thx for the reply.

My v4.16.0 standard has "CodeSnip 4" as the main window title, while the portable one says "CodeSnip 4 (Portable Edition)". Can't see any reason why 4.15.1 doesn't too. If what I suggest below doesn't work, please go and have a look at the title.

If you install a new standard edition over an older standard edition it should pick up the database automatically. Also installing a new portable edition over an earlier one, in the same directory, should also bring forward the user snippets. The problem comes in installing a portable edition alongside the standard edition. Standard edition stores data in %APPDATA% (by default) but, by definition a portable program can't do that because the data must be stored with the program so you can move it around.

This leads me to assume your 4.15.1 is standard edition. If that's the case we can fix this.

What follows will delete any snippets you may have created in 4.18.0 portable. If you have done this and want to keep them you should stop now and get back to me. Your existing snippets in 4.15.1 are not at risk.

  1. Run 4.15.1 - Your personal snippets should appear as normal.
  2. Make a backup of your personal snippets: use the Database | Backup database menu option and choose a directory and file name to save the backup in. The name can be anything: no extension required. Make a note of where you saved this file.
  3. In Windows Explorer go to the directory where you copied the 4.18.0 portable files. If you see directories named AppData and UserData delete them and all their content.
  4. Run 4.18.0 and select the Database | Restore user database option and navigate to where you stored the file in step 2. Select the file and click OK. After a wait you should see all your snippets appear. The program will have recreated AppData and UserData. You snippets should be stored in the AppData/UserDB directory.
  5. If you want to install my snippets database choose the Database | Install or Update DelphiDabbler Snippets Database menu option and follow the instructions in the wizard dialogue box that appears.

Finally, if you want to bring forward your settings from 4.15.1 the following might work.

  1. Close 4.18.0 portable.
  2. Start Windows Explorer.
  3. In the Explorer address bar enter %appdata%\DelphiDabbler\CodeSnip.4 and press enter. You should now be in the CodeSnip.4 directory.
  4. Copy the file User.config (and any file named Favourites) from CodeSnip.4 and paste them into the AppData directory where you installed 4.18.0 portable. If User.config or Favourites already exist then overwrite them.
  5. Open User.config from AppData in a text editor. You will see an INI format file.
  6. Look for any section named [IniFile] and change the value of the Version key to 16 and the value of ProgramVersion key to 4.18.0. If the [IniFile] section does not exist then create it and enter the keys and values manually.
  7. Save User.config
  8. Run 4.18.0 portable and see what it looks like!

I can't guarantee the setting changes will work - there are quite a lot of difference between the settings of the standard and portable applications. If anything seems screwed up just close 4.18.0 then delete User.config and restart 4.18.0. It will appear with its default settings and I'm afraid you will need to configure it manually.

delphidabbler commented 3 years ago

One more thought. The standard and portable editions don't know about each others snippets by design.

If your 4.15.1 install is the standard edition then you'd be better off installing the standard edition of 4.18.0 rather than the portable one. Your snippets should still be there.

Warning: like with any other software update it's safer to back up your snippets first like I described above

limelect commented 3 years ago

Thanks

delphidabbler commented 3 years ago

Added new FAQ re this issue in the Using CodeSnip FAQ