Can I use another Arduino board as a shift register?

Hopefully, the bad pins aren't the I2C pins.