Moving Intercom Conversations Between Instances
Here’s a quick way to move Intercom conversations from your test sandbox into production. Why would you ever want to do that? If you screw up your Rails deployment configurations and dev keys accidentally make it into production, you could end up with hundreds of customer conversations in your dev sandbox (ask me how I know!). The web ineterface doesn’t have any quick way to fix this (why would they?), so I had to use their API to iterate through the open conversations and manually recreate them in production. There wasn’t any information on how to do this to be found when Googling, and Intercom’s API doesn’t make this super easy, so I figured this post might someday help another unfortunate soul.
Note: There doesn’t seem to be a way to recreate each message individually so I just joined them together into one string. It’s not 100% seamless but it does in a pinch. Also, I don’t think Intercom’s API supports finding conversations that are unassigned so you may need to go through and assign them to an admin user before running this.
Hope this is useful for someone, someday!