$DCM4CHE2BIN/dcmsnd -L RESTOREAET $DESTAET@$DESTPACSIP:$DESTPACSPORT $SOURCEDATASTORE/
which you run on your 2.17.1 server
where
$DCM4CHE2BIN the directory where you have installed the dcmsnd
RESTOREAET is the AET name for your connection to the 2.18.3 server
$DESTAET is the AET of your 2.18.3 instance
$DESTPACSIP is the IP of your 2.18.3 instance
$DESTPACSPORT is the Port of your 2.18.3 instance
$SOURCEDATASTORE is the directory where your 2.17.1 server keeps all the raw dicom files (if you havent modified it it's in your Jboss_install_dir/server/default/archive/
Beware that, since you have several TB, I suggest that you run the above command on subdirectories of your datastore in order to send chunks of data at the time. So an example of the command could be: