Last active
May 7, 2019 02:28
-
-
Save thebrettbarlow/bdc66bfb13bba9a3eb9e4f8cd63ef6b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# query the accounts and put them in chatty_accounts_to_move__backup.csv | |
soql " | |
select id, name, ownerid, owner.name | |
from account | |
where ownerid = '005j000000Ea93uAAB' | |
" -u dev1 -r csv > chatty_accounts_to_move__backup.csv && | |
# cut out the Id of each account and set the new OwnerId | |
cat chatty_accounts_to_move__backup.csv | \ | |
cut -d "," -f 1 | \ | |
sed \ | |
-e '1 s/$/,OwnerId/' \ | |
-e '2,$ s/$/,005j000000BX4uCAAT/' > chatty_accounts_to_move.csv && | |
# upsert the accounts | |
sfdx force:data:bulk:upsert \ | |
--sobjecttype account \ | |
--externalid id \ | |
--csvfile chatty_accounts_to_move.csv \ | |
--targetusername dev1 \ | |
--wait 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment