# How do I move the blockchain (data.mdb) to a different directory during (or after) the initial sync without losing the progress?

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?

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.

• Can I check a config file to see if the gui did save the directory at step 3? Because the GUI does show me the correct location and the import raw guide stored everything in the default location. – JP Hellemons Jan 18 '18 at 9:53
• For config files, see: monero.stackexchange.com/questions/2866/…. The blockchain import is done by a different binary, namely monero-blockchain-import. I think you can add a custom directory there too (using --data-dir) so it places the imported blockchain (data.mdb) in the custom directory. However, if you already finished importing and it placed the blockchain in the default directory, it's probably best to just use this guide to move the blockchain. – dEBRUYNE Jan 18 '18 at 11:55
• that does not work... What´s wrong here? Using my Mac with an external Drive... created a new Folder /Monero/lmdb copied my existing chain from my local hard drive over - but i'm unable to connect to the daemon. Tried different ways - without any success... --data-dir /Volumes/WD\ 1TB\ Media/Monero/lmdb/data.mdb --data-dir /Volumes/WD\ 1TB\ Media/Monero/lmdb --data-dir /Volumes/WD 1TB Media/Monero/lmdb/data.mdb --data-dir /Volumes/WD 1TB Media/Monero/lmdb Didn't work .... any idea? Thanks in advance... – Simon Mar 8 '18 at 16:57
• A space in the path may cause issues. Perhaps try renaming the external drive to WD1TBMedia and then using --data-dir /Volumes/WD1TBMedia/Monero` – dEBRUYNE Mar 12 '18 at 20:40