Copy all data from pool1 to pool2 via command shell

Rob_HH

Dabbler
Joined
Oct 17, 2020
Messages
10
As you might assume right from the headline, I am a newbie.
I have 2 pools configuered in TrueNAS, 1 has data, and the other is - supprise supprise - empty. I want to copy all content of pool1 to pool2.
To do it via the network with a Windows client is I guess not really the best solution :smile:
So I think copy it directly on the TrueNAS server with a command on shell level might be best.
Question: Which command is it exactly?
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
use zfs send.
search the forum for usage
or just use replication from the gui.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You can also use the simple copy command form the shell if you desire to copy everything. If you have only a few GB of data, you could do it via Windows if you like, it will be as slow as your network connection. If you use the copy cp command then you must also do recursive. zfs send might be a safer option but for myself I see no real difference, but that could be my ignorance.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
If you want to copy all the data using the shell, you can use "cp" to copy everything recursively from source to destination:

# cp -ipr /source/ /destination/

Where
i Interactive. Will prompt you if overwriting files.
p Preserve file attributes like date, time, etc.
r Recursive. Will also copy subdirectories.
v Verbose. Will show each file as it is copied.

You can add the "v" parameter if you want to see a listing of all the files as they are copied. If you are copying a large number of small files this will make the copy process take longer to complete - but it might also give you some peace of mind to see the file names actually being copied.
 
Top