CREATE TEMPORARY TABLE tmp AS SELECT * FROM Instruments WHERE ProjectID=4;

ALTER TABLE tmp DROP IUnique;

UPDATE tmp SET IID=`GraithDonate`, ProjectId=33;

INSERT INTO Instruments SELECT 0,tmp.* FROM tmp;


CREATE TEMPORARY TABLE tmp AS SELECT * FROM InstrumentForms WHERE ProjectID=4;

ALTER TABLE tmp DROP IfUnique;

UPDATE tmp SET IID=`GraithDonate`, FID=`GraithDonateGift`, ProjectId=33;

INSERT INTO InstrumentForms SELECT 0,tmp.* FROM tmp;



CREATE TEMPORARY TABLE tmp AS SELECT * FROM Forms WHERE ProjectID=4;

ALTER TABLE tmp DROP fUnique;

UPDATE tmp SET FID=`GraithDonateGift`, ProjectId=33;

INSERT INTO Forms SELECT 0,tmp.* FROM tmp;


CREATE TEMPORARY TABLE tmp AS SELECT * FROM Questions WHERE ProjectID=4;

ALTER TABLE tmp DROP qUnique;

UPDATE tmp SET ProjectId=33;

INSERT INTO Questions SELECT 0,tmp.* FROM tmp;


CREATE TEMPORARY TABLE tmp AS SELECT * FROM FormQuestions WHERE ProjectID=4;

ALTER TABLE tmp DROP fqUnique;

UPDATE tmp SET FID=`GraithDonateGift`, ProjectId=33;

INSERT INTO FormQuestions SELECT 0,tmp.* FROM tmp;