Writes initial context data to database