Transfer of credit (masters) in Germany?
Credits must¹ be transferred if you are changing universities, this includes courses you have failed. Any course with the appropriate amount of credits that is 80 % or more equivalent to a course in the program you are transferring to will be transferred. Be prepared to do the paperwork, documenting the “Modulhandbuch” for all of the courses you have attempted.

You can only transfer, however, if there is space available in the target program. This is not always the case.



¹ This is demanded by federal law (Hochschulrahmengesetz, § 15(3)):


  Zum Nachweis von Studien- und Prüfungsleistungen soll ein Leistungspunktsystem geschaffen werden, das auch die Übertragung erbrachter Leistungen auf andere Studiengänge […] einer anderen Hochschule ermöglicht.
  
  (For certifying studying or examination accomplishments, a point-based system system shall be created that allows to transfer accomplishments to other degree courses of other universities.)


Specific realisations depend on the state or even the university. For example, the Berliner Hochschulgesetz states (§ 22 (2)):


  Die Hochschulen haben Studiengänge und Prüfungen so zu organisieren
  und einzurichten, dass insbesondere
  
  […]
  
  
  bereits erbrachte Studien- und Prüfungsleistungen bei einem Wechsel der
  Hochschule weitestgehend anerkannt werden können,
  
  
  […]
  
  (Universities have to organise courses and exams such that especially […] already achieved studying or examination accomplishments can be largely acknowledged when switching universities.)