16

I am currently performing the initial sync to the default directory, but my drive is nearly full. How do I move (and subsequently sync) the blockchain to another drive without losing the progress?

dEBRUYNE
  • 15,417
  • 18
  • 60
  • 114

3 Answers3

18

This is, fortunately, fairly trivial and you won't lose any of the progress. It is done as follows.

If you're using the GUI, perform the following steps:

  1. Create a new directory on the other/external drive. In addition, create a subdirectory called lmdb. Thus, if you, for example, created a directory called MoneroBlockchain on the other/external drive, you should also have MoneroBlockchain/lmdb (Linux & Mac OS X) or MoneroBlockchain\lmdb (Windows)

  2. Go to the Settings page of the GUI and add the full path of the new directory as Blockchain location

  3. Click in another box (on the Settings page) to ensure your settings are properly saved.

  4. Exit the GUI and make sure to stop the daemon as well.

  5. Browse to default directory for the blockchain (C:\ProgramData\bitmonero\lmdb on Windows | ~/.bitmonero/lmdb on Linux and Mac OS X)

  6. Note that aforementioned directories are hidden. On Windows, you can use the explorer to manually browse to it. On Mac OS X, you can typically use CMD+SHIFT+DOT to unhide directories. Lastly, on Linux, you can typically use CTRL + H to unhide directories.

  7. Copy data.mdb (the blockchain) to the new lmdb subdirectory directory.

  8. Restart the GUI.

  9. Use Show status (on the Settings) to verify that your daemon is properly syncing (i.e. fetching new blocks) to the new directory.


If you're using the CLI or running monerod separately from the GUI, perform the following steps:

[1] Exit the current monerod gracefully by typing exit

[2] Create a new directory on the other/external drive. In addition, create a subdirectory called lmdb. Thus, if you created a directory called MoneroBlockchain on the other/external drive, you should also have MoneroBlockchain/lmdb (Linux & Mac OS X) or MoneroBlockchain\lmdb (Windows).

[3] Browse to default directory for the blockchain (C:\ProgramData\bitmonero\lmdb on Windows | ~/.bitmonero/lmdb on Linux and Mac OS X).

[4] Note that aforementioned directories are, by default, hidden. On Windows, you can use the explorer to manually browse to it. On Mac OS X, you can typically use CMD+SHIFT+DOT to unhide directories. Lastly, on Linux, you can typically use CTRL + H to unhide directories.

[5] Copy data.mdb (the blockchain) to the new lmdb subdirectory directory.

[6a] On Windows, open a new command prompt from the same directory as monerod.exe. This is done by first making sure your cursor isn't located on any of the files and subsequently doing SHIFT + right click. It will give you an option to "Open command window here". If you're using Windows 10, it'll, most likely, give you an option to open the Powershell.

[6b] On Linux and Mac OS X, open a new terminal from the same directory as monerod

[7a] On Windows, type the following command in the command prompt:

monerod.exe --data-dir path\to\new\directory

If that doesn't work in the Powershell, type:

.\monerod.exe --data-dir path\to\new\directory

If that doesn't work either in the Powershell, type:

./monerod.exe --data-dir path\to\new\directory

[7b] On Linux and Mac OS X, type the following command in the terminal:

./monerod --data-dir path/to/new/directory

[8] Note that, if you're running monerod separately, you have to apply the flags every time you start monerod. Thus, on Windows, probably most convenient to create a shortcut, go to properties, and add the flags after the Target. On Linux and Mac OS X, it's probably most convenient to create a little script.

[9] Once monerod starts it should state (in the terminal or command prompt) where it's loading the blockchain from. Check whether this is the correct directory.

dEBRUYNE
  • 15,417
  • 18
  • 60
  • 114
1

Use a symlink (ln -s ...)to map default directory to a new path (linux cli):

[1] move or copy the ~/.bitmonero to new location. I prefer rsync:

rsync -avh ~/.bitmonero/ path/to/new/directory/

[2] Optionally, backup your original ~/.bitmonero:

mv ~/.bitmonero ~/bitmonerobak

[3] Generate a .bitmonero symlink that points to the new directory:

ln -s ~/.bitmonero path/to/new/directory

monerod's default location (~/.bitmonero) points to your new path and you can run it as normal.

alang
  • 11
  • 1
-1

short for linux cli users:

if all is right the monerod output will tell you

droid192
  • 99
  • 1