How can a archive data from a table to history db which are X days old

How can a archive data from a table  to history db (different server)   which are X days old ?