• Attention, TrueNAS Community Members. General Help has now been set to read-only mode. To make sure you can easily find what you're looking for, we've relocated all relevant categories under their respective version. This change will simplify searching for information and minimize any confusion about where to post.
Register for the iXsystems Community to get an ad-free experience

Howto: migrate data from one pool to a bigger pool

Lighthouse

Dabbler
Joined
Nov 15, 2018
Messages
15
I have updated my instruction, regarding snapshot creation in point 3 of my intruction. I found the problem during the process of updrading HDDs and found out this problem where TrueNAS refuses to move files because recursive snapshots are missing.
 

Lighthouse

Dabbler
Joined
Nov 15, 2018
Messages
15
So the time has passed since then and now I face another problem.


Since 2019, after 2 years finally data I store is outgrowing my main storage and I am in need to upgrade again.

The problem is I encrypted my main storage (legacy) and I am not sure how this is going to work. I fully upgraded my pool when TrueNAS arrived.

So far info is all over the place.
 

TooMuchData

Contributor
Joined
Jan 4, 2015
Messages
184
There have been a lot of posts recently about how to move data from one pool to another. Usually it's because folks want to upgrade to a much larger pool and the drive-by-drive resilvering process will take too long. I've recently gone through this as well. Here are the steps that I followed.

This assumes that you have both pools setup and connected to the same system, but the replication steps can be done between two systems and the disks moved after replication (this would apply in the instance where the primary machine doesn't have enough ports to handle the additional drives for the second pool).

Assumption is that "tank" is the primary dataset name. "temp-tank" is the name for the new pool prior to data migration.

The steps in a nutshell are replicate from tank to temp-tank, remove (or rename) tank, and then rename temp-tank to tank.

1. the system dataset needs to be moved off of TANK. Use the GUI to select a new location other than tank or temp-tank.

2. Create a system config backup using the GUI. This will be needed later, because when you detach tank, you will lose your share, snapshot and replication settings.

3. Use the GUI to create a snapshot of the dataset you want to move. If you want to move everything, select the root dataset. For flexibility in the future, I'd suggest checking the "recursive" option. Also, minimize use of tank. You will want to pick a time where nothing is changing, then ensure you have a snapshot, and then wait for replication to finish. The amount of time this will take depends on how much storage and the speed of your machine. It took ~36 hours to move 20TB locally for me. [ alternatively, you can use the CLI to create the snapshot and then replicate manually. "zfs snapshot -r tank@migrate" and then "zfs send -R tank@migrate | zfs receive temp-tank"]

4. Once replication is complete and you are satisfied that all data is on temp-tank it's time to detach both tank and temp-tank. Use the GUI to "detach volume" for tank and then repeat for temp-tank. When the confirmation window pops up DO NOT CHOOSE THE OPTION TO DESTROY.

5. using the CLI (or SSH) run the following to import and rename "zpool import tank old-tank" and then "zpool import temp-tank tank". (for reference: zpool import [old-pool-name] [new-pool-name-name])

6. Once the pools are renamed, export them at the CLI "zpool export old-tank" and "zpool export tank"

7. Using the GUI, go to the storage tab and select the import volume tab and import tank. This step is what
enables freenas to understand and control the pool.

8. Once the pool is imported, you can either manually recreate your shares, or you can restore from the configuration backup we made in step 2.

9. I would verify that everything is working to your liking before doing anything with old-tank. For safety, I'd leave it un-imported until you decide you need it or want to get rid of it. If you want to get rid of the data on the disks, I would import old-tank and then once it is in freenas, select the detach volume option for old-tank and this time select the destroy data option to blank out the drives. This is the point of no return, so know what you are doing before confirming.

[edit: note to self - here's the link to a great post on how to move Jails: https://forums.freenas.org/index.ph...-volume-to-new-ssd-volume.42105/#post-271740]
Everything worked, but I ended up with the same available space even though the "old-tank" was 6x8TB and "tank" is now 6x14TB. Am running scrub now in hopes I'll see more available space when it completes.

depasseg or anyone else, have you seen this before? Any other suggestions?

I cancelled the scrub in order to "expand pool". No change, still old available size. Then checked that autoexpand = ON. It was. Finally discovered that the root level dataset had a quota set. Removed that and now alles en orden.
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,418
Everything worked, but I ended up with the same available space even though the "old-tank" was 6x8TB and "tank" is now 6x14TB. Am running scrub now in hopes I'll see more available space when it completes.

depasseg or anyone else, have you seen this before? Any other suggestions?

I cancelled the scrub in order to "expand pool". No change, still old available size. Then checked that autoexpand = ON. It was. Finally discovered that the root level dataset had a quota set. Removed that and now alles en orden.
If you use zpool list -v it will show you the capacity of each vdev and I don't think you would have had your issues.
 

mysticpete

Contributor
Joined
Nov 2, 2013
Messages
137
I would think that if you have spare SATA ports then you can just use the replication feature to move/copy the whole pool or datasets to the new pool then when you have confirmed that that all the data has been copied you can take the old pool/dataset offline and swap them over/
 
Top