Is there anyway to use relative link instead of absolute link?

You should be using home_url() ( or something similar ) in your links for theme files when linking to pages. This will allow the domain to change and not affect your hardcoded links – assuming the ID’s are the same of course.

<a href="https://wordpress.stackexchange.com/questions/161179/<?php echo home_url();?>/?page_id=634">Link</a>

Good luck!