I have a node whose ID is 548754. I need it to be 301.
Is there a safe way to do this? There are a lot of tables related to 548754.
What if I export the database, open the SQL file, replace the number, and then import the database. Will this work?
A solution is using these two contrib modules:
They turn out to work together nicely. "Custom nid" only works for new nodes.. however "Quick node clone" takes you to an unsubmitted "new node" form... as such you can change the nid of the clone before saving it. After cloning you can throw away the original.
nid
andentity_id
in all tables, but you can not know if some modules didn't named it justid
. There yould be a problem if you replace it in editor like a string.drush sql-dump --ordered-dump | sed s/548754/301/g > new.sql; cat new.sql | drush sqlc
(assuming 301 doesn't exist and nothing else conflicts with 548754). This won't be bullet-proof for serialized data which would break in that case (if serialized data is cache, can be removed).