https://people.xiph.org/~greg/signdemo.txt
and
https://bitcoin.org/en/developer-examples#offline-signing
The top sections in signdemo.txt show how to get the txid(s), vout(s) and scriptPubKey(s) that you need. Basically, use "getrawtransaction" on your ONLINE machine with the txid for the transaction(s) that generated the UTXOs that you're spending. You'll get something like:
{
"hex" : "0100000001344630cbff61fbc362f7e1ff2f11a344c29326e4ee96e787dc0d4e5cc02fd06900000 0004a493046022100ef89701f460e8660c80808a162bbf2d676f40a331a243592c36d6bd1f81d6b df022100d29c072f1b18e59caba6e1f0b8cadeb373fd33a25feded746832ec179880c23901fffff fff0100f2052a010000001976a914dd40dedd8f7e37466624c4dacc6362d8e7be23dd88ac000000 00",
"txid" : "a9d4599e15b53f3eb531608ddb31f48c695c3d0b3538a6bda871e8b34f2f430c",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "69d02fc05c4e0ddc87e796eee42693c244a3112fffe1f762c3fb61ffcb304634",
"vout" : 0,
"scriptSig" : {
"asm" : "3046022100ef89701f460e8660c80808a162bbf2d676f40a331a243592c36d6bd1f81d6bdf02210 0d29c072f1b18e59caba6e1f0b8cadeb373fd33a25feded746832ec179880c23901",
"hex" : "493046022100ef89701f460e8660c80808a162bbf2d676f40a331a243592c36d6bd1f81d6bdf022 100d29c072f1b18e59caba6e1f0b8cadeb373fd33a25feded746832ec179880c23901"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 50.00000000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 dd40dedd8f7e37466624c4dacc6362d8e7be23dd OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a914dd40dedd8f7e37466624c4dacc6362d8e7be23dd88ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"n1gqLjZbRH1biT5o4qiVMiNig8wcCPQeB9"
]
}
}
]
}
Note the TXID, the "n" value and the "ScriptPubKey" hex value for the VOUT that you are spending in your new transaction. In this example we have:
txid: a9d4599e15b53f3eb531608ddb31f48c695c3d0b3538a6bda871e8b34f2f430c
vout: 0
scriptpubkey: 76a914dd40dedd8f7e37466624c4dacc6362d8e7be23dd88ac
Then you give these values as parameters on the OFFLINE machine when you use the "signrawtransaction" command:
inputs we're signing so our offline wallet knows which of its keys
to use.
[offline]$ bitcoind signrawtransaction 01000000010c432f4fb3e871a8bda638350b3d5c698cf431db8d6031b53e3fb5159e59d4a900000 00000ffffffff0100f2052a010000001976a9143744841e13b90b4aca16fe793a7f88da3a23cc71 88ac00000000 '[{"txid":"a9d4599e15b53f3eb531608ddb31f48c695c3d0b3538a6bda871e8b34f2f430c","vout":0,"scriptPubKey":"76a914dd40dedd8f7e37466624c4dacc6362d8e7be23dd88ac"}]'
{
"hex" : "01000000010c432f4fb3e871a8bda638350b3d5c698cf431db8d6031b53e3fb5159e59d4a900000 0006b48304502201123d735229382f75496e84ae5831871796ef78726805adc2c6edd36d23e7210 022100faceab822a4943309c4b6b61240ae3a9e18ed90a75117c5dc4bfd8f7e17a21d301210367c e0a1c3b3e84cece6dad1a181d989d8e490b84f5431a1f778a88b284c935e6ffffffff0100f2052a 010000001976a9143744841e13b90b4aca16fe793a7f88da3a23cc7188ac00000000",
"complete" : true
}
Be careful with the "'s and {'s and ['s etc Also, you will probably need to unlock your offline wallet first using "walletpassphrase" command before you can use the "signrawtransaction" command.
It *might* also be possible to copy your blocks folder from your online machine to your offline machine (if the offline machine has sufficient storage space)... and allow the offline machine to reindex those blocks which will bring your offline machine up to date with all the inputs etc... but I've never tried that, so I'm not sure if it will work or if it is advisable from a security point of view.