Ipfs node data migration

The ipfs that I set up store a lot of data, but there is a problem with my program, and I need to reinstall ipfs. How can I reduce the data stored in the ipfs node and migrate it together?

When I understand you correctly you want to copy the .ipfs folder from one installation to a new one, right?

You can always run ‘ipfs repo gc’ to remove all non-pinned content from your client’s cache.

If your ipfs doesn’t start anymore you can still backup the folder somewhere and move it to your new installation.

Yes, can you elaborate? Or give a relevant link?
No need to execute: “ipfs init”? In this way, can the previous ipfs id remain unchanged?